When I click on the textbox to activate it to enterable mode,
will be automatically filled with a word “undefined”.
How to cancel this autofill ?
When I click on the textbox to activate it to enterable mode,
will be automatically filled with a word “undefined”.
How to cancel this autofill ?
Hello,
It happens because the value is undefined
, so Gantt tries to convert it to the text type. You can modify it in the onBeforeEditStart
event and replace that value with the ''
:
gantt.ext.inlineEditors.attachEvent("onBeforeEditStart", function(state){
if (state.columnName == 'custom_property') {
var task = gantt.getTask(state.id);
if (task.custom_property == undefined) {
task.custom_property = '';
gantt.updateTask(task.id);
}
}
return true;
});
In the following snippet, you can see how it works:
http://snippet.dhtmlx.com/5/ede328e1c
It works ! thanks !!!