Our state of the art Gantt chart


Post by remyvillulles »

Hello,

The only way I found to call my setter would be in the creation of the grid here:

      {
        type: "estimatedDuration",
        text: intl.formatMessage(planningTableHead.projectTableDuration),
        locked: false,
        minWidth: 115,
        draggable: false,
        callback: () => {console.log("My setter is called")},
      },

I couldn't find any documentation explaining how to call a setter after registering my classes


Post by mats »

It would be much easier for you to just listen to https://bryntum.com/docs/scheduler/#Grid/feature/CellEdit#event-finishCellEdit

There you get all the info about what column / field changed and you can act upon it as you want. Does this satisfy your requirement?


Post by remyvillulles »

How do I integrate that in my custom column class and access it outside the class?


Post by mats »

gantt.on('finishCellEdit', event => { ... })

Post by remyvillulles »

It looks to be a good approach! However, how can I within all the data I receive identify what specific column has been modified? I have the ID for the tasks so I can identify it but I'm not sure I can determine exactly which column has been edited


Post by pmiklashevich »

Please check out the docs https://www.bryntum.com/docs/gantt/#Grid/feature/CellEdit#event-finishCellEdit
The handler function receives editorContext which has column and cell.

Pavlo Miklashevych
Sr. Frontend Developer


Post by remyvillulles »

Yes, I went through the properties and cannot find a unique identifier which guarantees me to be sure I'm targeting the right column. The closest I could get is called fullDuration35, it's autogenerated by Bryntum and could change at any time.


Post by mats »

The editorContext params you can see in docs has the Column instance which makes this very easy:

/**
         * Fires on the owning Grid when cell editing is finished
         * @event finishCellEdit
         * @param {Grid.view.Grid} grid Target grid
         * @param {Object} editorContext Editing context
         * @param {Core.widget.Editor} editorContext.editor The Editor being used.
         * Will contain an `inputField` property which is the field being used to perform the editing.
         * @param {Grid.column.Column} editorContext.column Target column
         * @param {Core.data.Model} editorContext.record Target record
         * @param {HTMLElement} editorContext.cell Target cell
         * @param {*} editorContext.value Cell value
         */

Post Reply