getState

gets the current state of the Gantt chart

object getState();

Returns

objectthe state object

Example

var opened_task = gantt.getState().lightbox;

Details

The state object reflects the inner UI configuration of the Gantt chart and has the following properties:

  • drag_id - (string) the id of a task that the user is currently dragging in the Gantt chart. 'Undefined' or 'null', if no tasks are being dragged in the Gantt chart.
  • drag_mode - ('move','resize','progress', 'ignore') the drag mode. 'Undefined' or 'null', if no tasks are currently being dragged in the Gantt chart.
  • fullscreen - (boolean) the flag for the fullscreen mode. 'True', if the Gantt chart is in the fullscreen mode, 'false' otherwise.
  • lightbox - (string) the id of a task that is currently opened in the lightbox. 'Undefined' or 'null', if no tasks are opened in the lightbox.
  • min_date - (Date) the date that tasks are displayed in the chart from
  • max_date - (Date) the date that tasks are displayed in the chart till
  • selected_task - (string) the id of the currently selected task. 'Undefined' or 'null', if no tasks are selected in the Gantt chart.
  • scale_unit - (string) the unit of the background grid of the timeline
  • scale_step - (number) the step of the background grid of the timeline

Note, the behavior of the Gantt chart can not be changed by modifying this object.

Back to top