I want disable 'Save' button if 'TotalUnits' < 0 . How can I disable actions 'Save' button?
Main Component:
AllocationDialog(data: any) {
const dialog: DialogRef = this.component.dialogService.open({
title: ' Allocations',
content: AllocationComponent,
actions: [
{ text: 'Save', primary: true, data },
],
width: 500,
height: 500
});
dialog.result.subscribe((dialogResult) => {
if (dialogResult instanceof DialogCloseResult) {
console.log('close');
} else {
console.log('action', dialogResult);
}
});
const allocationsInfo = dialog.content.instance;
allocationsInfo.TotalUnits = data.TotalUnits;
}
AllocationComponent - Dialog:
@Input() public TotalUnits: number;
<input kendoTextBox [(ngModel)]="TotalUnits" />