Premium support for our pure JavaScript UI components


Post by vbureanu »

Hello guys,

How we can customize Gantt context menu for different task levels?
1
1.1
1.1.1

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

Thanks,
Vitalie


Post by tasnim »

You can achieve it by using taskMenuBeforeShow event.
Please check docs : https://bryntum.com/docs/gantt/api/Gantt/feature/TaskMenu#event-taskMenuBeforeShow

Here is an example:

taskMenuBeforeShow({ taskRecord, items }) {
    if (taskRecord.isParent) {
        items.deleteTask.disabled = true;
    }
}

Post by vbureanu »

Hi Tasnim,

We tried to add, but without success.
After right click and menu appearing we dont see any action in console.
Any idea?

f1.png
f1.png (333.73 KiB) Viewed 324 times
f2.png
f2.png (753.53 KiB) Viewed 324 times

Post by tasnim »

Hi,
You need to use it in the ganttConfig like this :

ganttConfig = {
	...
	listeners : {
		taskMenuBeforeShow() { ... }
	}
}

And then you need to specify it in the <bryntum-gantt>

<bryntum-gantt
	#gantt
	...
	[listeners]   = "ganttConfig.listeners"
</bryntum-gantt>

Post by vbureanu »

Great!
It works!


Post Reply