Export and Import Report Settings (persistent)

QuestionsExport and Import Report Settings (persistent)
Mike Sheppard asked 8 years ago

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

5 Answers
Abu Ghufran answered 8 years ago

This is currently not supported, i'll try it out if it's doable by some customization.

Mike Sheppard answered 8 years ago

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

Abu Ghufran answered 8 years ago

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');

Abu Ghufran answered 8 years ago

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)

Massimo Gagliardi answered 8 years ago

Hi ABu
Is't possible to add a button in the show-hiding dialog to reset columns at the initial state?
Thanks in advance
Massimo Gagliardi

Your Answer

4 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?