Our state of the art Gantt chart


Post by mv2022 »

If a task is a parent, I would like to make a custom column called noOfResources readOnly.
Similar to

this.gantt.task store.getById(id).readOnly = true

but this would set all the columns to readonly and also disables the ability to delete that task.

For example something like this:

if( this.gantt.taskStore.getById(id).isParent ){
   this.gantt.taskStore.getById('id').noOfResources.readOnly = true;
}

Post by tasnim »

Hi,
Please check this: https://bryntum.com/docs/gantt/api/Grid/feature/CellEdit#event-beforeCellEditStart

Here is a little code snippet of how you can achieve it:

listeners : {
        beforeCellEditStart : ({editorContext}) => {
            return !editorContext.record.isParent || (editorContext.record.isParent && editorContext.column.field !== 'noOfResources');
        }
    }

Post Reply