Jqgrid statesave

<< Click to Display Table of Contents >>

Navigation:  Forum >

Jqgrid statesave

Forum link

 


 

10-17-2022, 03:11 PM:

 

Hello, 

 

I've to keep the order on a column for example when the user leaves the page and then returns back, now the grid is reloaded and loses any option. I've seen that there is a property when configurating datatables that stores state information such as pagination position, dislpay length, filterind and sorting. The code is as follows: 

 

Code:

 

$('#example').dataTable( {

 

  stateSave: true,

 

  stateSaveCallback: function(settings,data) {

 

      localStorage.setItem( 'DataTables_' + settings.sInstance, JSON.stringify(data) )

 

    },

 

  stateLoadCallback: function(settings) {

 

    return JSON.parse( localStorage.getItem( 'DataTables_' + settings.sInstance ) )

 

    }

 

} );

 

 

 

I'm not sure  that's possible to adapt this code to a jqdbgrid... I think i'm not understanding how it's jqdbgrid based, in wich javascript/jquery object because it isn't sharing the same code as datatables. or datatables code it's embeded into jqgrid object? 

 

Thank you very much. 

 

Blanca