Batch edit with child grids

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

    Posted 29 Sep 2015 Link to this post

    I guess I'm not understanding the hierarchical grid when it comes to editing. 

    Is the parent dataSource in no way connected to the child dataSources? So, when saving, I have to loop through and call save on every child grid? 

    Does it not use a hierarchical DataSource?

     

     

  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 01 Oct 2015 Link to this post

    Hello Bob,

    Grid hierarchy does not support hierarchical dataSource. Every Grid is a separate widget with separate DataSource. There is no way to connect the child's and parent's DataSources.

    In order to save all changes it is required to loop through every child Grid and call its saveChanges method.

    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 01 Oct 2015 in reply to Alexander Valchev Link to this post


    In order to save all changes it is required to loop through every child Grid and call its saveChanges method.

    I assume you have to do this with a jQuery DOM selector? Can you suggest the best selector?

     

  5. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 05 Oct 2015 Link to this post

    Hello Bob,

    All child Grid elements has k-grid class. You may find them with jQuery find method. See the following example:

    $("#grid").find(".k-grid").each(function(index, element) {
      $(element).data("kendoGrid").saveChanges();
    });


    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Paolo
    Paolo avatar
    3 posts
    Member since:
    Apr 2016

    Posted 28 May in reply to Alexander Valchev Link to this post

    Alexander Valchev said:Hello Bob,

    All child Grid elements has k-grid class. You may find them with jQuery find method. See the following example:

    $("#grid").find(".k-grid").each(function(index, element) {
      $(element).data("kendoGrid").saveChanges();
    });


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

     

    Hello Alexander, do you have a working example of this that you can show? I am trying to implement what you suggested but I dont know how or when exactly to call the function you have created so that when I make an edit to a field of my parent row, the same field for all the children rows get updated to this new value as well. Thank you!

  7. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    349 posts

    Posted 01 Jun Link to this post

    Hi Paolo,

    Unfortunately, we do not  have a working example of the discussed scenario, but in general, you can call the custom logic my colleague suggested in any custom event handler (e.g. a button click), as long as the parent Grid and its details Grids are initialized (the latter happens when a master row is expanded for the first time).

    I hope this helps, but if you need further assistance, please send us an isolated runnable project, demonstrating the issue, so we can provide further assistance.

    Regards,
    Dimiter Topalov
    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