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

Refreshing an unknown number of child grids

4 Answers 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vince
Top achievements
Rank 1
Vince asked on 16 Mar 2018, 03:46 PM

wn nI have a parent grid that contains n number of children grids. When a child grid has a value updated, the backend will change many values in the children grid but only the child that was selected by the user will be visually updated.

How do I force a refresh on all children grid that the child whom's data was updated without collapsing every grid? I know this should be using the "RequesEnd()" call but how do I iterate through an unknown # of children with relation to the parent the child belongs to? s

4 Answers, 1 is accepted

Sort by
0
Vince
Top achievements
Rank 1
answered on 16 Mar 2018, 03:47 PM
...I like how this forum has no edit functionality for typos =P
0
Viktor Tachev
Telerik team
answered on 19 Mar 2018, 12:19 PM
Hi Vince,

By default the users need to click the Save Changes button for the relevant Grid and then the modifications will be sent to the server. If you would like to save the changes from multiple Grid widgets you can call the saveChanges() method manually for each one. In order to get reference of all child Grids you can use jQuery and look for elements with "k-grid" CSS class that are nested in the main Grid. 

The dojo example below outlines the approach. It uses the jQuery Grid widget, however, the relevant logic will be the same for the MVC wrapper.


Let me know how the approach works for you.

Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vince
Top achievements
Rank 1
answered on 19 Mar 2018, 01:37 PM

Hi Victor, while I appreciate your response I don't think we are talking about the same thing.

Following the example you gave me, lets say we edit Nancy's order. The backend will also update an unknown # of other customer orders (lets say Janet, Margaret, and Steven.) I now need to retrieve/refresh all children grid or the data displayed may be different than what is in the backend, it is also possible that users have some of the grids open so I'd like to refresh the data without collapsing the grids.

 

Is this possible with Kendo without resorting to hacky techniques?

0
Viktor Tachev
Telerik team
answered on 20 Mar 2018, 09:49 AM
Hi Vince,

Thank you for clarifying the scenario.

By default the rows in the Grid will be collapsed when it is refreshed. In order to have them expanded I can suggest keeping track of what rows are expanded by the user. Then, when the Grid is refreshed iterate through the collection and expand the rows manually. With this approach the data in the detail grids will be re-read when they are expanded and any the most recent data will be shown. 


The example above illustrates the approach.

Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Vince
Top achievements
Rank 1
Answers by
Vince
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or