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

Batch edit with child grids

5 Answers 217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 29 Sep 2015, 09:31 PM

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?

 

 

5 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 01 Oct 2015, 01:13 PM
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!
 
0
Bob
Top achievements
Rank 1
answered on 01 Oct 2015, 02:00 PM

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

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

 

0
Accepted
Alexander Valchev
Telerik team
answered on 05 Oct 2015, 08:15 AM
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!
 
0
Paolo
Top achievements
Rank 1
answered on 28 May 2016, 06:51 PM
[quote]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!
 

[/quote]

 

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!

0
Dimiter Topalov
Telerik team
answered on 01 Jun 2016, 09:24 AM
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!
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Bob
Top achievements
Rank 1
Paolo
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Share this question
or