Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Jqgrid statesave
#1
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)