Premium support for our pure JavaScript UI components


Post by vbureanu »

Hello,

How we can disable changing/deleting of some level?
Is there some kind of "property" we can set on level to disable its removing/changing?

For example, we want to disable editing on level 1 and 1.1

Screenshot 2022-07-01 111058.png
Screenshot 2022-07-01 111058.png (504 KiB) Viewed 231 times

Thanks,
Vitalie


Post by tasnim »

To do so, you can use the taskMenuBeforeShow event.
Please check docs: https://bryntum.com/docs/gantt/api/Gantt/feature/TaskMenu#event-taskMenuBeforeShow

Here is an example of how you can achieve that :

taskMenuBeforeShow({ taskRecord, items }) {
    const wbsValue = taskRecord.wbsValue.value;
    if (wbsValue === "1" || wbsValue === "1.1") {
        // disable delete menu item
        items.deleteTask.disabled = true;
    }
}

Post by vbureanu »

It works, thanks!


Post Reply