read: (args) => {
if(args.classList.contains("e-autocomplete")){
return this.autoCompleteObj.value;
}
else
return this.dropDown.value;
}
write: (args: { rowData: Object, column: Column, element: HTMLElement }) => {
if(args.rowData["taskName"] == "Design"){
this.dropDown = new DropDownList({
dataSource: <{ [key: string]: Object }[] >this.treegrid.grid.dataSource,
fields: {value: 'taskName', text:"taskName"}
});
this.dropDown.appendTo(args.element);
}else{
this.autoCompleteObj = new AutoComplete({
dataSource: <{key: string, value: any}[]>this.treegrid.grid.dataSource,
fields: { value: 'taskName' },
value: args.rowData[args.column.field]
});
this.autoCompleteObj.appendTo(args.element);
}
} |