|
[app.component.ts]
this.contextMenuItems = ['AutoFit', 'AutoFitAll', 'SortAscending', 'SortDescending',
'Copy', 'Edit', 'Delete', 'Save', 'Cancel',
'PdfExport', 'ExcelExport', 'CsvExport', 'FirstPage', 'PrevPage',
'LastPage', 'NextPage', { text: 'Lock Account' , target: '.e-content', id: 'lockAccount' },
{ text: 'UnLock Account' , target: '.e-content', id: 'unlockAccount' }];
}
public contextMenuOpen(args:any){
var contextMenuObj = this.grid.contextMenuModule
.contextMenu;
if (args.rowInfo.rowData.Status== "Active") {
contextMenuObj.showItems(["Lock Account"]);
contextMenuObj.enableItems(["Lock Account"], true);
contextMenuObj.hideItems(["UnLock Account"]);
} else {
contextMenuObj.showItems(["UnLock Account"]);
contextMenuObj.enableItems(["UnLock Account"], true);
contextMenuObj.hideItems(["Lock Account"]);
}
}
|