
I want to persist what child detail grid is open on return to the page. I tried using the localstorage example
var options = kendo.stringify(grid.getOptions())
localStorage.setItem("kendo-grid-options", options);
but this does not seem to keep the open expanded row details.
Is there an event that fires when oi expand a row, then maybe I could use that to record the row number and expand using js when page is loaded, thanks
4 Answers, 1 is accepted
Hello Alan,
Only the Grid options are stored in local storage when using the mentioned approach. They does not include the expanded/collapsed rows. Indeed you could use the Grid events to achieve the task. Please refer to the detailExpand / detailCollapse pages for more information.
Regards,Dimiter Madjarov
Telerik


Sorry to bother you again Dimiter, I think I am close to my solution but getting an error.
SCRIPT5022: Syntax error, unrecognized expression: {"0":{"sizzle1439558070376":{"parentNode":[45,55,true]}},"length":1,"prevObject":{"0":{},"context":{},"length":1},"context":{}}
jquery-2.1.4.js (1458,2)
var TermProgram = {
ExpandedRow: null,
Load: function () {
var row = localStorage.getItem("kendo-grid-row");
if (row) {
this.expandRow(JSON.parse(row));
}
},
SaveState: function (e) {
if (TermProgram.ExpandedRow != null && TermProgram.ExpandedRow[0] != e.masterRow[0]) {
var grid = $('#TermProgramGrid').data('kendoGrid');
grid.collapseRow(TermProgram.ExpandedRow);
}
TermProgram.ExpandedRow = e.masterRow;
localStorage.setItem("kendo-grid-row", kendo.stringify(e.masterRow))
},
.........
In the page with the grid I have
I have messed with stringify and parse but still get error.
Thanks
Hello Alan,
Currently Kendo UI has not been tested under jQuery 2.1.x versions. I would suggest to try the approach with one of the officially supported versions. If the problem is still persisting, please send us small isolated runnable example that demonstrates it, so we could inspect it locally.
Regards,Dimiter Madjarov
Telerik