Our state of the art Gantt chart


Post by tunika619 »

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!


Post by mats »

Sorry, it's not clear what you are trying to do. You want inline edit to be disabled? Then you should set 'cellEdit' feature to false and for:

I want to get the row data when clicking the cell in the main/first/default (name) column. 

Please listen to 'cellClick' event: https://bryntum.com/docs/scheduler/#Grid/view/mixin/GridElementEvents#event-cellClick


Post by tunika619 »

Hi @mats.

I guess I figure out how to handle the problems. The only one left is to disable the edit, but still listen to events, so I can handle it on my own. At the same time also to disable the right click edit, but if setting the 'editor: false' then clicking the cell does not fires the onChange/onClick event. Any ideas to disable/hide the right click menu/editor that pops up?
Using the following code works for the Column Header, but not for the Cell right-click.
p.s. readOnly is set to true

enableCellContextMenu: false,
enableHeaderContextMenu: false

Post by alex.l »

Hi tunika619,

enableCellContextMenu: false should disable context menu, this is a bug, here is a ticket: https://github.com/bryntum/support/issues/1056
For your solution, take a look on events of context menu feature: https://www.bryntum.com/docs/scheduler/#Grid/feature/ContextMenu#event-cellContextMenuBeforeShow

All best,
Alex

All the best,
Alex


Post by tunika619 »

Hi!

The following code added as prop to BryntumGantt did the job.

        contextMenuTriggerEvent={false}

I hope this can help others facing the same issue.

Regards,
Georgi


Post Reply