|
[App.component.ts]
actionComplete(args: DialogEditEventArgs): void {
if ((args.requestType === 'beginEdit' || args.requestType === 'add')) {
//here you can change the button content as per your requirement
let btnObj = (args.dialog as any).btnObj[0];
btnObj.content = 'Create';
//here you can enable/disable the button based on the form validation
btnObj.disabled = !this.orderForm.valid;
this.orderForm.statusChanges.subscribe((e)=> {
e === 'VALID' ? btnObj.disabled = false : btnObj.disabled = true;
});
. . .
} |
|
[app.component.ts]
actionBegin(args: SaveEventArgs): void {
if (args.requestType == "cancel") {
this.orderForm.statusChanges.unsubscribe();
}
} |