Our state of the art Gantt chart


Post by malwina »

Hey!

Is there a way to make a custom validation of dependency creation that would also affect the creation tooltip? We'd like to use your core tooltip, but provide our own validation so that, for example, we prevent the dependency loop (task A is a predecessor to task B, so we don't want to allow task B to be a predecessor to task A).

Second question, is there a way to block creating a dependency from only one side of the task? Let's say I'd like to be able to create a dependency only from the end date side of the task.


Post by tasnim »

Is there a way to make a custom validation of dependency creation that would also affect the creation tooltip?

I don't see anything related to it in our docs. So I opened a ticket for it here https://github.com/bryntum/support/issues/8909

But you can always use https://bryntum.com/products/gantt/docs/api/Scheduler/feature/Dependencies#event-beforeDependencyCreateFinalize event to validate dependency creation. If you want to decline an creation operation just return false from that event.

Second question, is there a way to block creating a dependency from only one side of the task? Let's say I'd like to be able to create a dependency only from the end date side of the task.

To do so, you can set https://bryntum.com/products/gantt/docs/api/Gantt/feature/Dependencies#config-terminalSides to ['end'].
And it will only show terminals on the right side.

Hope it helps.

Best regards,
Tasnim


Post by malwina »

Thank you, Tasnim!

About the creation tooltip - in that case, is there a way to disable the "Valid/Invalid" side of the tooltip? I tried making our own with creationTooltipTemplate, but it still shows that green section on the right of the tooltip. Maybe I chose the wrong prop?

Cheers
Malwina


Post by tasnim »

You could use this css to remove it

.b-sch-dependency-creation-tooltip > header {
    display: none;
}

Post by malwina »

Great, thanks!


Post Reply