Is there an easy way to disable paging when searching in a JQGrid?
When a user searches I want to display all of the search results on one page.
Basically I want rowNum: 10000 and the pager disabled but only when a user searches.
Edit: Got this to work with something like:
beforeRequest: function () {
if (jQuery("#ClientPickerGrid").getGridParam('search') == true) {
jQuery("#ClientPickerGrid").setGridParam({ rowNum: 10000 })
}
The usage of
rowNum: -1is not supported by jqGrid especially if you use local datatype orloadonce: trueoption. You should use and large enough value likerowNum: 1000orrowNum: 10000.UPDATED: The solution can depend on the
datatypewhich you use and on the value of theloadonceparameter. Moreover you can use some events existing in searching. So if you write about searching you should always write which one from the searching you use.If no other information is known you can use
beforeRequestevent to test whethersearchparameter of jqGrid is set totrue. In the case you can temporary change the value ofrowNumand restore it’s original value inloadComplete. If you send the request to the server (if you usedatatype: 'json'ordatatype: 'xml') it can be important to change therowsvalue sent to the server. You can do this inside ofserializeGridDataevent handler. Inside ofserializeGridDatathesearchwill be seen in the posted data as_search.