Our state of the art Gantt chart


Post by shimnx »

Some tasks cannot be copied and pasted. Is there any way I can prevent this


Post by tasnim »

Hello Shimnx,

I'm not sure I got your question,

Do you want to implement that behavior that some tasks shouldn't have the ability to copy?


Post by shimnx »

Yes, I wish some missions couldn't be replicated


Post by tasnim »

Sure. Then, you could use https://bryntum.com/products/gantt/docs/api/Gantt/feature/TaskMenu#event-taskMenuBeforeShow to disable the copy button on the taskMenu

    listeners : {
        taskMenuBeforeShow(event) {
            const { taskRecord, items } = event;
            if (taskRecord.name === 'Install Apache') {
                items.copy.disabled = true;
            }
        }
    }

Post by shimnx »

Yes I used this method, but I can still copy it with the ctrl+c shortcut


Post by mats »

Try using instead: https://bryntum.com/products/gantt/docs/api/Gantt/feature/TaskCopyPaste#event-beforePaste

to filter out your tasks you don't want copied?


Post Reply