App.component.ts
actionComplete(args) {
console.log('actionComplete', args, this.gridObj);
if (args.requestType === 'save') {
this.gridObj.refresh();
}
} |
[app.component.html]
<ejs-grid #gridObj [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar' [allowRowDragAndDrop]="true" (beforeDataBound)="beforeDataBound($event)" >
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true' [validationRules]='orderidrules'></e-column>
<e-column field='CustomerName' headerText='Customer Name' width='120' [validationRules]='customeridrules'></e-column>
</e-columns>
</ejs-grid>
-------------------------------------------------------------------------------------------------------------------
[app.component.ts]
beforeDataBound(args) {
if (args.requestType === 'save' && this.gridObj.isEdit) {
args.data = extend(args.rowData, args.data)
}
}
|