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

Problems with inline edit of subgrid

1 Answer 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 21 Apr 2020, 08:55 AM

I've got a grid with a child grid. I'm trying to provide edit functionality for the child grid. Add and Update functions don't work. When I press the Save button nothing happens. I noticed a knowledge base post discussing how to do this. We'll its not really a discussion just some code with a title but no description of what's going on. Reading the code it seems like there can be a binding issue with the parent grid. I implemented the same code in my grids and it made no difference. I removed what I thought was the code to help the binding problem from the sample and I can't see any difference in the operation of the girds. I'm wondering if someone could clue me in here? May this issues was fixed recently and I'm looking at an out dated article in the knowledge base, or, of course I could have screwed something up.

Here's the link to the knowledge base article.

https://docs.telerik.com/kendo-ui/knowledge-base/edit-master-row-data-in-detail-template

Here's a link to code where I attempted to remove the code for the parent table binding issue.

https://jsfiddle.net/6afd93pn/

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 23 Apr 2020, 08:15 AM

Hi Mark,

The example that you have provided binds the inner child grid to a property from the master row. This property is a collection of items. The CRUD operations are handled inside the read, update, create, destroy options of its data source. 

Within the functions of interest, the items get modified in the context of the parent grid. Therefore, the save should be done after clicking the Save changes button of the parent grid. 

However, the approach that is provided in the knowledge base article is applicable only when the data of the inner child grids come from a property from the parent grid. Could you share more information whether this is the functionality you are willing to achieve, or, you would like to create standalone inner grid instances?

In case, the second approach is the one you would like to go for, I would recommend adding all of the buttons for create, update, delete in the context of the child grid. The schema.model.id has to be set. Also, the CRUD handlers in the data source have to be setup as if the grid is not nested inside another grid. 

Let me know of the details around the scenario you are willing to achieve. It would be very helpful if you could provide the relevant code snippets, or, ideally, a sample project in which the behavior could be observed.

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or