Persistent Settings

QuestionsPersistent Settings
Craig asked 9 years ago

Hi there,

I love this product, however am having an issue that I've spent far too long trying to figure out.

The grid loads and filters correctly, however I cannot get it to remember the settings at all.

I've used the persist-settings.php demo and tried to ensure that my code is the same (as much as can be), however, I'm using CodeIgniter and from what I can see, the XHR in your demo is looking at the persist-settings.php file, and mine is referring to json2.js.

There are no 404's, the JS is readable. It simply appears that the session data is not written, and therefore cannot be referenced.

Is there any special requirements for making this work with CI? I've re-written the stock CI session handling due to bugs, but I'd assume that the JS writes it's own cookie?

Can you please shed any light?

Thanks,

Craig.

2 Answers
Abu Ghufran answered 9 years ago

There are 2 steps to persist settings.

Step1: include js files.
<script src="//cdn.jsdelivr.net/jstorage/0.1/jstorage.min.js" type="text/javascript"></script>
<script src="//cdn.jsdelivr.net/json2/0.1/json2.min.js" type="text/javascript"></script>
<script src="//cdn.rawgit.com/gridphp/jqGridState/03b2bd484aecf8f47c810e7ba60606fe1a6fb7ec/jqGrid.state.js" type="text/javascript"></script>

Step2: include persist settings.
var opts = {
"stateOptions": {
storageKey: "gridState-list1",
columns: true, // remember column chooser settings
selection: true, // row selection
expansion: true, // subgrid expansion
filters: true, // subgrid expansion
pager: true, // page number
order: true // field ordering
}
};

Complete demo here: http://hastebin.com/welocigiga.php
The jqGrid.state.js file included in demo is more updated and have more bugs fixed.

Craig answered 9 years ago

Thanks for your prompt reply Abu.

I've not had a chance just yet to test the solution provided, however, can confirm that with exception to the updated jqGrid.state.js update, all other steps provided are completed.

I'll upgrade the jqGrid.state.js and give it another try.

My implementation is integrated with CodeIgniter – are there any known issues with this config?

Cheers,

Craig.

Your Answer

7 + 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?