|
actionBegin(args) {
if (args.requestType === 'save') {
if (args.previousData.ShipCountry != args.data.ShipCountry) {
args.data.Verified = (args.data.Verified === true) ? false : true;
}
}
}
|
|
[app.conponent.html]
<e-column field='ShipCountry' [edit]='dpParams' headerText='Ship Country' width='170'></e-column>
[app.component.ts]
createdrop(args) {
debugger;
this.elem = document.createElement('input');
return this.elem;
}
readdrop(args) {
return this.dropInstance.value;
}
destroydrop(args) {
this.dropInstance.destroy();
}
writedrop(args: { rowData: object, column: any }) {
this.dropInstance = new DropDownList({
dataSource: ['Berlin', 'Austria', 'Beligium', 'Brazil', 'France'],
fields: { text: 'ShipCountry', value: 'ShipCountry' },
value: (args.rowData as any).ShipCountry,
change: this.change.bind(this)
});
this.dropInstance.appendTo(this.elem);
}
change(args) {
if (args.element.form[4].ej2_instances[0].checked) {
args.element.form[4].ej2_instances[0].checked = false;
}
else {
args.element.form[4].ej2_instances[0].checked = true;
}
}
ngOnInit(): void {
. . . .
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, newRowPosition: 'Top' };
this.dpParams = {
create: this.createdrop.bind(this),
read: this.readdrop.bind(this),
destroy: this.destroydrop.bind(this),
write: this.writedrop.bind(this)
};
. . .
}
|