Gantt ยท console.warn
gantt: a '{event}' before-handler threw; the action was cancelled.
Printed by Gantt, prefixed [lattice], since 1.36.0.
Warnings reference › gantt.beforeThrow:*
- Identifier
gantt.beforeThrow:*- Raised by
- Gantt
- Since
- 1.36.0
What happened
A before-handler on the gantt controller threw. A throw is treated as a veto, so the edit, delete or dependency change did not happen, and the cancellation event fired with the reason. It is reported so that a cancel nobody asked for is not mistaken for a broken controller.
The fix
The error is attached to the console line. Return false (or call preventDefault()) to veto deliberately.
The smallest fix
gantt.on('beforeTaskEdit', (e) => { if (locked(e.task)) e.preventDefault('locked'); });
Reference
Covered in full at the API reference.