开发者

Question on JqGrid paging

开发者 https://www.devze.com 2023-01-07 00:38 出处:网络
I would like not to lose the paging and the sort parameters when I leave a page with a grid and I come back to this page.

I would like not to lose the paging and the sort parameters when I leave a page with a grid and I come back to this page.

Is it possible to get the page, rowNum, sortname, sortorder params (I think with getGridParam), put them in the URL scope, go to another page, and get those params back through the URL scope and give them in the URL hereafter in the code ? (putting Act_country.cfc?method=getAllCountries&page=url.pageNum does no开发者_运维百科t give anything...)

jQuery(document).ready(function(){  
    jQuery('#list').jqGrid({  
    url:'Act_country.cfc?method=getAllCountries',
    datatype: 'json',
    mtype:'GET',
    colNames:[
    '<cfoutput>#StLabels["LBL_TAB_EDIT"]#</cfoutput>',
    '<cfoutput>#StLabels["LBL_TAB_COUNTRY_CODE"]#</cfoutput>',
        ...

Thank you in advance, Michel


You can also save the information which you need in cookie. See http://www.intothecloud.nl/index.php/2010/04/saving-jqgrid-parameters-in-cookie/ or Remember (persist) the filter, sort order and current page of jqGrid


You need a Session scope.

Check the existence of params with StructKeyExists(Session, "param"), if they are not present yet -- consider this first visit and put the variables, otherwise use values from session. If user changes the paging/sorting -- refresh the values in the session.

0

精彩评论

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

关注公众号