I am trying to find a way to export, then import report settings.
Why? So I can have a way to set-up multiple reports on different machines the same-way AND to set-up a report with multiple options by importing different Grid Settings.
I have been trying JSON to 'stringify' the LocalStorage without much luck.
Have you done such a thing? Having a way to go back to 'default' settings without having reset all cookies would be convenient.
Thanks
Mike Sheppard
This is currently not supported, i'll try it out if it's doable by some customization.
Thanks, Abu. I looked-over some options and it seems straight-forward – I just don't have the necessary skills to do-so (I was looking at the jqGrid.state.js code).
I can stringify and update the entire LocalStorage Key – but that doesn't help me with individual Pages.
I use a variable-name on each report so the gridState-XXX is unique for every report page.
Thanks for any help you can offer.
Mike Sheppard
Hi,
I tried to make solution for persistance, but it's currently time taking and added in backlog.
You can contact some local developer to use storage api and make persistance database driven based on user logged in.
// get state settings
var savedState = jQuery.jStorage.get('gridState-list1');
var str = JSON.stringify(savedState);
console.log(str);
// set state settings
var dataToSave = jQuery.parseJSON(str);
jQuery.jStorage.set('gridState-list1', dataToSave);
jQuery('#list1').gridState().refresh();
// del state settings
jQuery.jStorage.deleteKey('gridState-list1');
You can call following to forget the settings.
$('#list1').gridState().remove('gridState-list1');
where list1 is grid id
'gridState-list1' is the name set in stateoptions.
After that you can do a page reload (location.reload() to refresh)