// method.js file
actionComplete: function (args) {
……………….
if( this.pendingAction ){
if (args.requestType === 'delete') {
this.pendingAction(args); // pass args to update the rowData on pendingAction method.
}
this.pendingAction = undefined;
}
},
// services.js file
finalChange: function ( answer, rowData) {
………………
if (answer) {
if (rowData.hasChildRecords && rowData.childRecords[0].TypeLigne === 'FR') {
………………………………..
this.pendingAction = (args) => {
rowData.FractionText = "New Child Added";
if(args.data[0].Key == rowData.childRecords[0].Key){ // check the primary key data here, use your primary key field name.
rowData.childRecords = []; // if record deleted then, empty the childRecords from rowData variable before passing it into addNewRecord method
}
this.addNewRecord(rowData, 'FR', 'Child', rowData.Poids, 100)
}
…………………
} else if (rowData.hasChildRecords && rowData.childRecords[0].TypeLigne === 'FM') {
………………………………
}
………………
},
|