Hello Syncfusion team,
ej2-angular-grids version
^19.2.49
Hierarchical Child Grid DropDown Not Update to the JSON Array. When changing the child grid dropdown value it is not updated to the JSON Array. I want to know how to get the LAST Edited grid['currentViewData'].
Parents Grid Policy DropDown change Data correctly updated to the JSON Array. But Child Grid change data is not updated.
Can you please help with this ASAP?
OUTPUT ARRAY
CODE :
|
<div class="control-section">
<ejs-grid #Grid id='Grid' [editSettings]="editSettings" [dataSource]='parentData' (actionComplete)="actionComplete($event)" [toolbar]='toolbar' [childGrid]='childGrid'>
<e-columns>
<e-column field='EmployeeID' isPrimaryKey='true' headerText='Employee ID' width='120' textAlign='Right'></e-column>
<e-column field='FirstName' headerText='Name' width='140'></e-column>
<e-column field='Title' editType="dropdownedit" headerText='Title' width='170'></e-column>
<e-column field='HireDate' headerText='Hired Date' width='120' format='yMd' textAlign='Right'></e-column>
<e-column field='ReportsTo' headerText='Reports To' width='120' textAlign='Right'></e-column>
</e-columns>
</ejs-grid>
</div> |
|
export class AppComponent {
@ViewChild('Grid', {static: true})
public grid: GridComponent;
public parentData: Object[];
public childGrid: any;
public toolbar = ['Update', 'Cancel'];
public editSettings = {allowEditing: true};
actionComplete (args) {
if (args.requestType === 'save') {
// here we can get the currentview data for parent grid
console.log('Parent Grid currentViewdata', this.grid.getCurrentViewRecords());
// here we can get the current edited data for parent grid
console.log('Edited data', args.data);
}
}
ngOnInit(): void {
this.parentData = employeeData;
this.childGrid = {
dataSource: orderDatas,
queryString: 'EmployeeID',
allowPaging: true,
toolbar:['Update', 'Cancel'],
editSettings: {allowEditing: true},
pageSettings: {pageSize: 6, pageCount: 5},
actionComplete (args) {
if (args.requestType === 'save') {
// here we can get the currentview data for child grid
console.log('Child Grid currentViewdata', this.getCurrentViewRecords());
// here we can get the current edited data for child grid
console.log('Edited data', args.data);
}
},
columns: [
{ field: 'OrderID', isPrimaryKey: true, headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'ShipCity', headerText: 'Ship City', width: 120 },
{ field: 'Freight', headerText: 'Freight', width: 120 },
{ field: 'CustomerID', headerText: 'Customer ID', width: 150, editType: 'dropdownedit',
edit: {
params: {
allowFiltering: true,
dataSource: new DataManager(hierarchyOrderdata),
fields: { text: 'CustomerID', value: 'CustomerID' },
change: (data: any) => {
console.log(data);
},
query: new Query(),
actionComplete: () => false,
},
},
}
],
};
}
} |