|
<e-column field='CustomerID' headerText='Customer ID' [allowEditing]= 'false'
[validationRules]='customerIDRules' width=120></e-column> |
|
public ngOnInit(): void {
this.data = orderDetails;
this.pageSettings = { pageCount: 5 };
this.filterSettings = { type: 'Menu' };
this.toolbarItems = ['Add', 'Edit', 'Delete', 'Update', 'Cancel'];
this.customerData = customerData;
this.editOptions = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Dialog' };
this.orderidrules = { required: true };
this.ddlData = DataUtil.distinct(customerData,'ContactName',true),
this.dpParams = {
create: () => {
this.elem = document.createElement('input');
return this.elem;
},
read: () => {
return this.dropDownListObj.value;
},
destroy: () => {
this.dropDownListObj.destroy();
},
write: (args) => {
this.dropDownListObj = new DropDownList({
dataSource:this.ddlData,
fields: {value:'CustomerID', text: 'ContactName' },
value:args.rowData[args.column.field],
});
this.dropDownListObj.appendTo(this.elem);
}
};
}
onClick() {
this.grid.getColumnByField('CustomerID').dataSource=customerData;
this.grid.refreshColumns();
} |
|
<e-column field='CustomerID' headerText='Customer Name' width='150'
foreignKeyValue='ContactName' foreignKeyField='CustomerID' [edit]='dpParams' [validationRules]='orderidrules'></e-column>
|