Master / Details – reload Master and keep subgrid open

QuestionsMaster / Details – reload Master and keep subgrid open
mofel asked 7 years ago

Hello Abu,

I'm working on this kind of master / detail:
http://phpgrid.org/demo/demos/master-detail/multi-subgrid.php

When updating / detils detail's row, i need to reload master AND keep the row expanded.

Is there anyway to make it ?

Thanks
Mofel

3 Answers
Abu Ghufran answered 7 years ago

You can enable grid state persistance on parent grid.

<script>
var opts = {
"stateOptions": {
storageKey: "gridState-list-sg",
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
}
};
</script>
<?php echo $out?>

expansion: true will give your desired work.

mofel answered 7 years ago

Hi Abu,

Thanks but when i add these 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>

I have the JS error in the console:

Uncaught TypeError: Cannot read property 'updateFilterToolbar' of undefined
at HTMLTableElement.opts.gridComplete (jqGrid.state.js:484)
at HTMLTableElement.a.updatepager (jquery.jqGrid.min.js:135)
at Y (jquery.jqGrid.min.js:68)
at Object.success (jquery.jqGrid.min.js:81)
at j (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at x (jquery.min.js:4)
at XMLHttpRequest.b (jquery.min.js:4)

Do you have any advise about this ?

Thanks

Abu Ghufran answered 7 years ago

Please try after using this latest script for state persistance.
<script src="//cdn.rawgit.com/gridphp/jqGridState/e06788e68cd9f97db9da4bb4ba1c4a82890aed9e/jqGrid.state.js" type="text/javascript"></script>

Your Answer

6 + 13 =

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?