this.countryParams = {
create: () => {
this.countryElem = document.createElement('input');
return this.countryElem;
},
destroy: () => {
this.countryObj.destroy();
},
read: () => {
return this.countryObj.text;
},
write: (args) => {
let data = this.country.filter((e) => {
return e.countryName == args.rowData[args.column.field];
});
this.countryObj = new DropDownList({
change: () => {
this.stateObj.enabled = true;
const tempQuery = new Query().where('countryId', 'equal', this.countryObj.value);
this.stateObj.query = tempQuery;
this.stateObj.text = '';
this.stateObj.value = null;
this.stateObj.dataBind();
},
dataSource: new DataManager(this.country),
fields: { value: 'countryId', text: 'countryName' },
floatLabelType: 'Never',
value: data[0].countryId,
placeholder: 'Select a country'
});
this.countryObj.appendTo(this.countryElem);
}
}; |