Description
The GANTTCreate event occurs before a GANTT chart is created. Use this event to modify the GANTT chart settings.
Syntax
GANTTCreate(ganttElement, tasks, settings, proxy, pageObj)
Arguments
ganttElement
DOM element where GANTT chart will be created.
tasks
an array of tasks
settings
GANTT chart settings
proxy
data transferred from PHP code using setProxyValue function.
pageObj
an object representing the current page. For more information, see RunnerPage class.
Applies to pages
Official Frappe GANTT component documentation: https://github.com/frappe/gantt?tab=readme-ov-file#configuration
Examples
Example 1. Change column width.
// width of individual columns
settings.column_width = 35;
return new Gantt( ganttElement, tasks, settings );
Example 2. Allow view mode selection and set the default view mode to 'Day'.
// allow switching between view modes: Year,Week,Day etc
settings.view_mode_select = true;
// the initial view mode of the chart
settings.view_mode="Day";
return new Gantt( ganttElement, tasks, settings );
See also: