Hi, everyone!
I have faced an issue using the editor property on a column in Gantt chart.
I want to get the row data when clicking the cell in the main/first/default (name) column. When using the following code and just logging the data in the console I get all of it, but when I call a function instead I get a weird data - just the cell value and no additional information.
Is there a better way to do it or any advice someone can give me? One think I don't get it why the renderer gets all the information about row, cell etc. and the editor doesn't accept any arguments that can be passed to some function?
{
type: "name",
field: "name",
text: "Name",
editor: {
onChange: (event) => {
console.log("event: ", event); // if only this line - all information about the row is shown
this.handleClick(event); // if adding this line the result is as in the followed code sample(*)
},
}
},
(*) Result when calling the function: showing just the value of the cell, but no additional infromation.
{value: "Test", oldValue: "", event: undefined, userAction: false, valid: true, …}
event: undefined
oldValue: ""
source:
isDestroyed: true
Symbol(instanceProperties): {}
_lastValue: "Test"
type: "change"
userAction: false
valid: true
value: "Test"
__proto__: Object
Additional problem I faced is using the event (that is for some reason undefined) and calling the preventDefault() function on it, so I can disable the inline edit of the cell.
Another additional problem with the editing is that I can't disable the right-click editor even if editor is set to false.
Expected behavior:
- inline edit is disabled
- instead a custom react form component is called and the data is editable from there
I would really appreciate any help by configuring the Gantt chart
Thanks in advice!