Atozed Forums
Jqgrid statesave - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: Jqgrid statesave (/thread-2892.html)



Jqgrid statesave - Blanca80 - 10-17-2022

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