2

I am using JQGrid to implement some requirements on a client site and love the tool, but have been unable to overcome one obstacle.

I need to keep the search parameters in place on a page refresh. I am using Multiple search and have the first part down which is to grab the search parameters when a search is performed. I am using the following code to do it:

...
loadBeforeSend: function (xhr) {
  var postData = $("#list").jqGrid('getGridParam', 'postData');
  var outData = '';
  $.each(postData, function(key, value) {
    if (key!='_search'){
      outData = outData + key + '=' + value + '|';
    }
  });
  window.location.hash = escape(outData);
},
...

This works great and on refresh I can easily grab the search data, however I have been unable to figure out how to default the search parameters to these values.

I am willing to move over to a filter toolbar implementation if that is easier.

daviesgeek
  • 789
  • 3
  • 13
  • 30
Nate Bunney
  • 1,958
  • 1
  • 18
  • 27

1 Answers1

0

What you need is just modification of some postData properties. Some other old answers about very close subjects could show you how to manipulate postData properties: this answer, another one, this one and this one. All the example from the answers shows which role play postData and search parameter for all kind of jqGrid searching.

Community
  • 1
  • 1
Oleg
  • 217,934
  • 30
  • 386
  • 757