Expanding child detail grid event

5 posts, 0 answers
  1. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 14 Aug 2015 Link to this post

    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

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 14 Aug 2015 Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 14 Aug 2015 in reply to Dimiter Madjarov Link to this post

    Thanks Dimiter, I had just found the events that I missed before,
  5. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 14 Aug 2015 in reply to Dimiter Madjarov Link to this post

    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


     
     
     
     
  6. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 17 Aug 2015 Link to this post

    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready