Smart Search posting using __doPostback paging issue

Tracey Penberthy asked on July 20, 2017 16:33

Hi

I have a web part with a smart search dialog, some filters and a results web parts on, the results have paging enabled.

These are all contained in an update panel.

There is a requirement to have two Search buttons on the page.

So I thought I could call the search when you click the second button in javascript via __doPostBack(updatePanelID);

This works but with the results when I click a paging link the filters are all reset (I guess because the filter values are not set in the url (e.g. category=policies).

How can I set the filter values in the url when calling the search action from javascript?

Or is there a better method for having 2 submit buttons on the page (one is next to the search text input, the second has to go under all the filters)

Many Thanks Tracey

Correct Answer

Brenden Kehren answered on July 20, 2017 18:32

Using javascript you could set the dummy button to trigger a click event on the main button and stop the dummy button from following through with the full click. Might look something like this:

$("#dummyButton").click(function(e){
    e.preventDefault();
    $("#mainButton").click(); 
    // or i've had better luck with this
    // $("#mainButton").trigger('click');
    return false;
});
0 votesVote for this answer Unmark Correct answer

Recent Answers


Tracey Penberthy answered on July 20, 2017 19:00

Thanks Brenden

That worked a treat! (I used the trigger method)

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.