Hi Suman,
Greetings from Syncfusion support.
We are not able to clearly understand your requirement from the provided information. We suspect you need the updated grid data and child grid data(Of a particular row). If so you can get the entire grid and child grid data source using the Grid’s dataSource property(If local data is bound to the Grid). For getting the current view records alone you can use the Grid’s getCurrentViewRecords method to get the updated current view data. This can be achieved for the main Grid and a Child Grid rendered for a particular parent row as demonstrated in the below code snippet,
|
// Main(Parent) grid instance
var gridInst = document.getElementById('Grid').ej2_instances;
// Data source for parent grid
var parentGridData = gridInst.dataSource;
// Current view data for parent grid
var parentGridData = gridInst.getCurrentViewRecords();
// Returns a parent row element based on the index
var selectedParentRow = grid.getRowByIndex(0);
// Returns the parent row’s child grid instance
var childGridInstance = selectedParentRow.nextElementSibling.querySelector('.e-grid').ej2_instances[0];
// Data source for the entire child grid
var childGridData = childGridInstance.dataSource;
// Current view data for the particular child grid
var childGridData = childGridInstance.getCurrentViewRecords(); |
Note: From the code file you had provided we could see that you have not defined a primary key column field for the Parent and Child Grid. Editing feature requires a primary key column for the CRUD operations. To define primary key, set columns.isPrimaryKey to true in particular column. More details on this can be checked in the below help documentation link,
If we misunderstood your requirement can you please elaborate on it, if possible with a pictorial representation so that we can check and provide the proper solution for it.
Regards,
Sujith R