4

I have a situation where I need to display announcements based on year and month. On the page I have a dropdown essentially for Year and Month which will drive the Content Search Web Part. Using query parameters I can control the data in the Content Search Web Part, but I was wondering if it there is a way for me to refresh the CSWP without redirecting to a page with the new query parameters (basically an Ajax Style refresh for CSWP).

Let me know if more explanation on this scenario is needed.

1

What if you had a custom Search Box/Refiner control (you can use Display templates to modify this control using dropdowns, etc.) that then directs the query to the CSWP on the same page? You can set this up in the Web Part properties.

This is essentially how the Enterprise Search page works.

Otherwise, if you wanted to contain this in one control, I would take a look at how different components such as the 'Sort' dropdown works in Search Results web part. Some functions are available in the CSWP. The dropdown calls a function:

$getClientControl(document.getElementById('Id of CSWP')).sortOrRank('value to sort by');`

That should be a few ideas to get you started. Good Luck!

  • Thanks for the feedback, I will be implementing this solution over the weekend and will provide an update as to what I did and how it worked. Thanks! – widmayer Jul 24 '14 at 22:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.