Posted 27 June 2018, 1:48 am EST
Hi Manish,
I followed the example shared by you. It is working for Dropdown, numbers and date, but not working for textarea. For Date the calendar is showing inside the cell. Before following this method I am able to add input to the String type cell in the column, But after adding the below I am getting some error in console:
ConditionFlag–String
ERROR TypeError: Object doesn’t support this action
TypeScript code:
var control;
var responseCellType = s.rows[e.row].dataItem[“cellDataType”];
console.log(“ConditionFlag–”+responseCellType);
if (responseCellType==‘Number’) {
control = new wjInput.InputNumber(rootEl, {step: 5 });
control.value = Number(s.getCellData(e.row, e.col, false));
}
else if(responseCellType==‘DropDown’){
control = new wjInput.ComboBox(rootEl, {
itemsSource: ‘Yes,No’.split(‘,’)
});
control.selectedValue = s.getCellData(e.row, e.col, false);
} else if (responseCellType==‘Date’) {
control = new wjInput.Calendar(rootEl);
control.value = (s.getCellData(e.row, e.col, false));
}else{
control = new HTMLTextAreaElement();
control.value = s.getCellData(e.row, e.col, false);
}
var cellEditEndHandler = (s, args) => {
s.cellEditEnding.removeHandler(cellEditEndHandler);
if (!args.cancel) {
args.cancel = true;
if (responseCellType==‘Number’) {
s.setCellData(args.row, args.col, control.value, false);
} else if(responseCellType==‘DropDown’) {
s.setCellData(args.row, args.col, control.selectedValue, false);
}
else if(responseCellType==‘TextArea’) {
s.setCellData(args.row, args.col, control.value, false);
}else{
s.setCellData(args.row, args.col);
}
control.dispose();
}
}
s.cellEditEnding.addHandler(cellEditEndHandler);
});
Thanks,
Yashobanta