This is a migrated thread and some comments may be shown as answers.

Expanding child detail grid event

4 Answers 494 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alan Mosley
Top achievements
Rank 1
Alan Mosley asked on 14 Aug 2015, 07:03 AM

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

Sort by
0
Dimiter Madjarov
Telerik team
answered on 14 Aug 2015, 12:07 PM

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Alan Mosley
Top achievements
Rank 1
answered on 14 Aug 2015, 12:15 PM
Thanks Dimiter, I had just found the events that I missed before,
0
Alan Mosley
Top achievements
Rank 1
answered on 14 Aug 2015, 01:29 PM

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


 
 
 
 
0
Dimiter Madjarov
Telerik team
answered on 17 Aug 2015, 11:16 AM

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Alan Mosley
Top achievements
Rank 1
Share this question
or