开发者

How do I rebuild a JQGrid query on page refresh?

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 (ke开发者_运维知识库y!='_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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜