Sub grid batch edits lost when adding a row

4 posts, 0 answers
  1. Bob
    Bob avatar
    138 posts
    Member since:
    Sep 2012

    Posted 28 Sep 2015 Link to this post

    We have a batch edit grid with a sub batch edit grid. It all works fine unless we want to add a row. When we do the sub grid edits are lost. 

    Is this a bug, or not supported?

     

     

  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 30 Sep 2015 Link to this post

    Hi Bob,

    The behaviour is expected and occurs because the child grid is destroyed and re-created when its parent Grid rebinds.
    Adding a new row to the parent triggers the rebind action.

    As a workaround you may hook up to the dataBinding event of the parent Grid and call the saveChanges method of the child.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Bob
    Bob avatar
    138 posts
    Member since:
    Sep 2012

    Posted 30 Sep 2015 in reply to Alexander Valchev Link to this post

    That's essentially what I am doing. But, as you say a "workaround", it would be nice if a hierarchical data source is used so existing child records would be re-bound as well. At least, I think that's what the hierarchical datasource give you, maybe I don't fully understand it either.

    What is the recommended way to find the rows that have child grids attached to them that need to be saved? My way seems quite a bit kludgy.

     

     

  5. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 02 Oct 2015 Link to this post

    Hello Bob,

    You may use role selector to select all Grid elements.

    $("#parentGrid")
      .find("[data-role=grid]")
      .each(function(idx, element) { console.log(element); });


    But, as you say a "workaround", it would be nice if a hierarchical data source is used so existing child records would be re-bound as well. At least, I think that's what the hierarchical datasource give you, maybe I don't fully understand it either.

    Thank you for the feedback, I will forward your suggestion to the team for further discussions.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready