UNPKG

dhtmlx-gantt

Version:

An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.

1,566 lines (1,319 loc) 215 kB
// Type definitions for dhtmlxGantt 9.0.11 // Project: https://dhtmlx.com/docs/products/dhtmlxGantt type GanttCallback = (...args: any[]) => any; export interface GanttEventCallback { /** * fires when autoscheduling is done * @param taskId the root task id * @param updatedTasks an array with the ids of rescheduled tasks */ "onAfterAutoSchedule"(taskId: string | number, updatedTasks: any[]): void; /** * fires after the api/gantt_batchupdate.md method was called */ "onAfterBatchUpdate"(): void; /** * if dynamic loading is enabled, fires after the task branch was loaded to the page * @param settings an object which contains the task id and request URL */ "onAfterBranchLoading"(settings: any): void; /** * fires after the user has closed the lightbox (edit form) */ "onAfterLightbox"(): void; /** * fires after a new link is added to the Gantt chart * @param id the link id * @param link the link object */ "onAfterLinkAdd"(id: string | number, link: Link): void; /** * fires after the user deletes a link * @param id the link id * @param link the link object */ "onAfterLinkDelete"(id: string | number, link: Link): void; /** * fires after the user updates a link * @param id the link id * @param link the link object */ "onAfterLinkUpdate"(id: string | number, link: Link): void; /** * fires after the pop-up edit form is closed * @param taskId the task id */ "onAfterQuickInfo"(taskId: string | number): void; /** * fires after the redo() method was called * @param action a user action as an array of command objects */ "onAfterRedo"(action: any[]): void; /** * fires after resizing of the row height is finished * @param id the task id * @param task the item object * @param oldHeight the old height of the row * @param newHeight the new height of the row */ "onAfterRowResize"(id: string | number, task: Task, oldHeight: number, newHeight: number): void; /** * fires after tasks are sorted in the grid * @param field the name of the column that the grid was sorted by or a custom sorting function * @param desc optional, the sorting direction: <i>true</i> - descending, <i>false</i> - ascending<br> * @param parent optional, the id of the parent task, if the tasks were sorted only in the branch of the specified parent */ "onAfterSort"(field: string | GanttCallback, desc?: boolean, parent?: string | number): void; /** * fires after the user adds a task to the Gantt chart * @param id the task id * @param task the task object */ "onAfterTaskAdd"(id: string | number, task: Task): void; /** * fires for each task which has been autoscheduled * @param task the task object * @param start a new start date * @param link the link object that creates the constraint * @param predecessor the predecessor task object */ "onAfterTaskAutoSchedule"(task: Task, start: Date, link: Link, predecessor: Task): void; /** * fires after the user deletes a task * @param id the task id * @param task the task object */ "onAfterTaskDelete"(id: string | number, task: Task): void; /** * fires after the user has finished to drag and released the mouse button * @param id the task id * @param mode the drag-and-drop mode ("resize", "progress", "move", "ignore") * @param e a native event object */ "onAfterTaskDrag"(id: string | number, mode: string, e: Event): void; /** * fires after a task was moved to a new vertical position * @param id the id of the task to move * @param parent the parent id * @param tindex the index of the position in the parent branch that the task will be moved to */ "onAfterTaskMove"(id: string | number, parent: string | number, tindex: number): void; /** * fires after the user updates a task * @param id the task id * @param task the task object */ "onAfterTaskUpdate"(id: string | number, task: Task): void; /** * fires after the undo() method was called * @param action an array of command objects */ "onAfterUndo"(action: any[]): void; /** * fires if the server returns an error * @param request XML HTTP request object */ "onAjaxError"(request: any): boolean; /** * fires if some dependency loops were found during auto scheduling * @param groups an array of dependency loops found in gantt */ "onAutoScheduleCircularLink"(groups: any[]): void; /** * fires before auto scheduling * @param taskId the root task id */ "onBeforeAutoSchedule"(taskId: string | number): boolean; /** * fires before the api/gantt_batchupdate.md method is called */ "onBeforeBatchUpdate"(): void; /** * if dynamic loading is enabled, fires after a user expands the task branch but before loading starts * @param settings an object which contains the task id and request URL */ "onBeforeBranchLoading"(settings: any): boolean; /** * before gantt exits the fullscreen mode and goes back to normal mode */ "onBeforeCollapse"(): boolean; /** * fires before data is rendered on the page */ "onBeforeDataRender"(): void; /** * fires before gantt is expanded to full screen */ "onBeforeExpand"(): boolean; /** * fires before the dhtmlxGantt initialization is started */ "onBeforeGanttReady"(): void; /** * fires before the Gantt chart is rendered on the page */ "onBeforeGanttRender"(): void; /** * fires immediately before the user opens the lightbox (edit form) * @param id the task id */ "onBeforeLightbox"(id: string | number): boolean; /** * fires before a new link is added to the Gantt chart * @param id the link id * @param link the link object */ "onBeforeLinkAdd"(id: string | number, link: Link): boolean; /** * fires before the user deletes a link * @param id the link id * @param link the link object */ "onBeforeLinkDelete"(id: string | number, link: Link): boolean; /** * fires after the links have been loaded to the Gantt chart but before they are displayed * @param id the link id * @param link the link object */ "onBeforeLinkDisplay"(id: string | number, link: Link): boolean; /** * fires before a link is updated * @param id the link id * @param new_link the new (updated) object of the link */ "onBeforeLinkUpdate"(id: string | number, new_link: Link): boolean; /** * fires before selecting a task or a range of tasks * @param e a native event object */ "onBeforeMultiSelect"(e: Event): void; /** * fires before data started to be parsed */ "onBeforeParse"(): void; /** * fires before the redo() method is called * @param action a user action as an array of command objects */ "onBeforeRedo"(action: any[]): boolean; /** * fires before an action is added into the redo stack * @param action a user action as an array of command objects */ "onBeforeRedoStack"(action: UndoRedoAction): boolean; /** * fires before the rollup task is displayed on its parent project * @param taskId the rollup task id * @param task the rollup task object * @param parentId the id of the parent (project) task */ "onBeforeRollupTaskDisplay"(taskId: number | string, task: Task, parentId: number | string): boolean; /** * fires when a user drops a row in the grid * @param sid the id of the task to move * @param parent the parent id. If specified, the <b>tindex</b> will refer to the index in the <br> <b>'parent'</b> branch * @param tindex the index of the position that the task will be moved from <br> (the index in the whole tree) */ "onBeforeRowDragEnd"(sid: string | number, parent: string | number, tindex: number): boolean; /** * fires before a row of the grid is dragged vertically to a different position * @param id the id of the task to move in the grid * @param parent the parent id * @param tindex the index of the position in the parent branch that the task will be moved to */ "onBeforeRowDragMove"(id: string | number, parent: string | number, tindex: number): boolean; /** * fires before the user starts to resize the row height by drag-and-drop * @param task the task object */ "onBeforeRowResize"(task: Task): boolean; /** * fires before resizing of the row height is completed * @param id the task id * @param task the task object * @param newHeight the new height of the row */ "onBeforeRowResizeEnd"(id: number | string, task: Task, newHeight: number): boolean; /** * fires before a part of the split task is displayed on the Gantt chart * @param id the id of the subtask * @param task the object of the subtask * @param parent the object of the parent task */ "onBeforeSplitTaskDisplay"(id: number | string, task: Task, parent: any): boolean; /** * fires before a new task is added to the Gantt chart * @param id the task id * @param task the task object */ "onBeforeTaskAdd"(id: string | number, task: Task): boolean; /** * fires for each task which is rescheduled * @param task the task object * @param start a new start date * @param link the link object that creates the constraint * @param predecessor the predecessor task object */ "onBeforeTaskAutoSchedule"(task: Task, start: Date, link: Link, predecessor: Task): boolean; /** * fires after the user has finished dragging and released the mouse button but before the changes are applied * @param id the task id * @param mode the drag-and-drop mode ("resize", "progress", "move", "ignore") * @param task the copy of the task object in its original state (before drag and drop) */ "onBeforeTaskChanged"(id: string | number, mode: string, task: Task): boolean; /** * fires before the user deletes a task * @param id the task id * @param task the task object */ "onBeforeTaskDelete"(id: string | number, task: Task): boolean; /** * fires after the tasks have been loaded to the Gantt chart, but before they are displayed * @param id the task id * @param task the task object */ "onBeforeTaskDisplay"(id: string | number, task: Task): boolean; /** * fires after the user has pressed the mouse button and started dragging, but before dhtmlxGantt starts the drag-and-drop operation * @param id the task id * @param mode the drag-and-drop mode ("resize", "progress", "move", "ignore") * @param e a native event object */ "onBeforeTaskDrag"(id: string | number, mode: string, e: Event): boolean; /** * fires before a task is moved to a new vertical position * @param id the id of the task to move * @param parent the parent id * @param tindex the index of the position in the parent branch that the task will be moved to */ "onBeforeTaskMove"(id: string | number, parent: string | number, tindex: number): boolean; /** * fires before the task selection state is being changed (the task is being selected or unselected) * @param id the id of a task * @param state true if the task is going to be selected, false - if unselected * @param e a native event object */ "onBeforeTaskMultiSelect"(id: string | number, state: boolean, e: Event | null): void; /** * fires before the user selects a task * @param id the task id */ "onBeforeTaskSelected"(id: string | number): boolean; /** * fires before the user updates a task * @param id the task id * @param new_task the new (updated) object of the task */ "onBeforeTaskUpdate"(id: string | number, new_task: Task): void; /** * fires before the undo() method is called * @param action an array of command objects */ "onBeforeUndo"(action: any[]): boolean; /** * fires before an action is added into the undo stack * @param action a user action as an array of command objects */ "onBeforeUndoStack"(action: UndoRedoAction): boolean; /** * fires when the circular reference has been detected and auto scheduling is not possible * @param link the link object * @param group a group of tasks and links connected in a loop */ "onCircularLinkError"(link: Link, group: any): void; /** * fires after all tasks were removed from the Gantt chart by the api/gantt_clearall.md method */ "onClear"(): void; /** * fires when gantt went back to normal mode from the full screen mode */ "onCollapse"(): void; /** * fires when the user is dragging the column's border to resize the column * @param index the column index * @param column the column object * @param new_width the new column's width */ "onColumnResize"(index: number, column: GridColumn, new_width: number): void; /** * fires after the user finished dragging the column's border to resize the column * @param index the column index * @param column the column object * @param new_width the new column's width */ "onColumnResizeEnd"(index: number, column: GridColumn, new_width: number): boolean; /** * fires before the user starts to drag the column's border to resize the column * @param index the column index * @param column the column object */ "onColumnResizeStart"(index: number, column: GridColumn): boolean; /** * fires when a user clicks the right mouse button inside the Gantt chart (see the details) * @param taskId the task id * @param linkId the link id * @param e a native event object */ "onContextMenu"(taskId: string | number, linkId: string | number, e: Event): void; /** * fires on the `dp.init(gantt)` call * @param DataProcessor the DataProcessor object */ "onDataProcessorReady"(DataProcessor: any): void; /** * fires after data has been rendered on the page */ "onDataRender"(): void; /** * called after gantt has been cleared by the api/gantt_destructor.md method */ "onDestroy"(): void; /** * fires when the user clicks on an empty space in the Gantt chart (not on tasks) * @param e a native event object */ "onEmptyClick"(e: Event): void; /** * fires when api/gantt_assert.md receives 'false' value, i.e. when assertion fails * @param errorMessage a string with an error from the api/gantt_assert.md method */ "onError"(errorMessage: string): boolean; /** * fires when gantt is expanded to full screen */ "onExpand"(): void; /** * fires after the Gantt layout is ready, but before it is rendered */ "onGanttLayoutReady"(): void; /** * fires after the dhtmlxGantt initialization is complete but the Gantt chart is not rendered on the page yet */ "onGanttReady"(): void; /** * fires after the Gantt chart was rendered on the page */ "onGanttRender"(): void; /** * fires when the Gantt chart is scrolled to a particular point * @param left the position of horizontal scroll * @param top the position of vertical scroll */ "onGanttScroll"(left: number, top: number): void; /** * fires when the user clicks on the grid's header * @param name the name attribute of the column which header the user clicks on * @param e a native event object */ "onGridHeaderClick"(name: string, e: Event): boolean; /** * fires when the user is dragging the grid's border to resize the grid * @param old_width the initial grid's width * @param new_width the new grid's width */ "onGridResize"(old_width: number, new_width: number): void; /** * fires after the user finished dragging the grid's border to resize the grid * @param old_width the initial grid's width * @param new_width the new grid's width */ "onGridResizeEnd"(old_width: number, new_width: number): boolean; /** * fires before the user starts to drag the grid's border to resize the grid * @param old_width the initial grid's width */ "onGridResizeStart"(old_width: number): boolean; /** * fires after the user has opened the lightbox (edit form) * @param task_id the id of the task opened in the lightbox */ "onLightbox"(task_id: string | number): void; /** * fires when the user clicks on a custom button in the lightbox * @param css the name of the CSS class applied to the button * @param node an HTML element of the clicked button * @param e a native 'click' event object */ "onLightboxButton"(css: string, node: HTMLElement, e: Event): void; /** * fires when the user clicks on the 'Cancel' button in the lightbox * @param id the task id ( the task opened in the lightbox) */ "onLightboxCancel"(id: string | number): void; /** * fires when the structure of the lightbox is changed * @param old_type the name of the initial lighbox's structure * @param new_type the name of the new lighbox's structure */ "onLightboxChange"(old_type: string, new_type: string): void; /** * fires when the user clicks on the 'Delete' button in the lightbox * @param id the task id (the task opened in the lightbox) */ "onLightboxDelete"(id: string | number): boolean; /** * fires when the user clicks on the 'Save' button in the lightbox * @param id the id of unmodified task. Note, at this stage the lightbox values aren't applied to the task object yet and you can access the initial task using gantt.getTask(id) * @param task the modified task object * @param is_new specifies whether the user opens the lightbox to create a new task (<i>true</i>)<br> or update an existing one (<i>false</i>) */ "onLightboxSave"(id: string | number, task: Task, is_new: boolean): boolean; /** * fires when the user clicks on a link * @param id the id of the clicked link * @param e optional, a native event object */ "onLinkClick"(id: string | number, e?: Event): void; /** * fires when a user creates a new link between tasks * @param link the object of a new link */ "onLinkCreated"(link: Link): boolean; /** * fires when the user double clicks on a link * @param id the id of the clicked link * @param e optional, a native event object */ "onLinkDblClick"(id: string | number, e?: Event): boolean; /** * fires when the id of a link is changed * @param id the current link id * @param new_id the new link id */ "onLinkIdChange"(id: string | number, new_id: string | number): void; /** * fires when the user adds a new link and dhtmlxGantt checks whether the link is valid * @param link the link object */ "onLinkValidation"(link: Link): boolean; /** * fires after loading data from the data source has been completed * @param url the server-side url (may be a static file or a server side script that outputs data) * @param type ('json', 'xml', 'oldxml') the data type */ "onLoadEnd"(url: string, type: string): void; /** * fires immediately before loading data from the data source has been started * @param url the server-side url (may be a static file or a server side script that outputs data) * @param type ('json', 'xml', 'oldxml') the data type */ "onLoadStart"(url: string, type: string): void; /** * fires when the mouse is moved over the gantt container * @param id the id of the task that the mouse is moved over * @param e a native event object */ "onMouseMove"(id: string | number, e: Event): void; /** * fires after selection of a task or a range of tasks has been completed * @param e a native event object */ "onMultiSelect"(e: Event): void; /** * fires after a collection of options has been loaded from the server, but isn't parsed yet */ "onOptionsLoad"(): void; /** * fires after data was parsed (became available for API) but before it was rendered in the Gantt chart */ "onParse"(): void; /** * fires when the pop-up edit form appears * @param taskId the task id */ "onQuickInfo"(taskId: string | number): void; /** * fires after the user drops a vertically reordered row in the grid * @param id the id of the task that the user has dragged vertically in the grid * @param target the id of the task which place the dragged row has occupied */ "onRowDragEnd"(id: string | number, target: string | number): void; /** * fires before the user drags a row of the grid to vertically reorder it * @param id the id of the task that the user drags in the grid * @param target an HTML element of the task that the user drags * @param e a native event object */ "onRowDragStart"(id: string | number, target: HTMLElement, e: Event): boolean; /** * fires when the user is dragging the border of the row to resize the row height * @param id the task id * @param task the task object * @param currentHeight the current height of the row */ "onRowResize"(id: string | number, task: Task, currentHeight: number): void; /** * fires when the scale is re-rendered in order to display all tasks completely */ "onScaleAdjusted"(): void; /** * fires when the user clicks on the cell in the time scale * @param e a native event object * @param date the date of the clicked cell */ "onScaleClick"(e: Event, date: Date): void; /** * fires when the user clicks on a task row in the grid area (including the 'expand/collapse' and 'add task' buttons) or on a task bar in the timeline area * @param id the id of the clicked task * @param e optional, a native event object */ "onTaskClick"(id: string | number, e?: Event): boolean; /** * fires when a branch has been closed * @param id the branch id */ "onTaskClosed"(id: string | number): void; /** * fires when a user creates a new task by pressing the'+' button in a grid, or when the api/gantt_createtask.md method is called * @param task the object of a new task */ "onTaskCreated"(task: Task): boolean; /** * fires when the user double clicks on a task * @param id the id of the double clicked task * @param e a native event object */ "onTaskDblClick"(id: string, e?: Event): boolean; /** * fires when the user drags a task * @param id the task id * @param mode the drag mode ("resize", "progress", "move", "ignore") * @param task the current (dragged) task object * @param original the original(initial) task object * @param e a native event object */ "onTaskDrag"(id: string | number, mode: string, task: Task, original: Task, e: Event): void; /** * fires when the id of a task is changed * @param id the current task's id * @param new_id the new task's id */ "onTaskIdChange"(id: string | number, new_id: string | number): void; /** * fires when a task is being loaded from the data source * @param task the object of a task */ "onTaskLoading"(task: Task): boolean; /** * fires after the task selection state has changed (the task has been selected/unselected) * @param id the id of a task * @param state true if the task has been selected, false - if unselected * @param e a native event object */ "onTaskMultiSelect"(id: string | number, state: boolean, e: Event): void; /** * fires when a branch has been opened * @param id the branch id */ "onTaskOpened"(id: string | number): void; /** * fires when the user clicks on a row in the table * @param id the task id * @param row an HTML element of the clicked row */ "onTaskRowClick"(id: string | number, row: HTMLElement): void; /** * fires when the user selects a task * @param id the task id */ "onTaskSelected"(id: string | number): void; /** * fires when the user unselects a task by selecting some other task * @param id the task id (of the unselected task) */ "onTaskUnselected"(id: string | number): void; /** * fires when the dhtmlxGantt templates are initialized */ "onTemplatesReady"(): void; } export interface GanttTemplates { /** * specifies the text displayed inside the baseline element * @param task the task object associated with the baseline * @param baseline the baseline object * @param index the index of the baseline in the task's baselines array */ baseline_text(task: Task, baseline: Baseline, index: number): string | number | void; /** * specifies the content of columns that show dates (return `Date` values) in grid * @param date the date which needs formatting * @param task the task object * @param column the name of the column that called the template */ date_grid(date: Date, task: Task, column: string): string; /** * specifies the text of tooltips that are displayed when the user creates a new dependency link * @param from the id of the source task * @param from_start <i>true</i>, if the link is being dragged from the start of the source task, <i>false</i> - if <br> from the end of the task * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start <i>true</i>, if the link is being dragged to the start of the target task, <i>false</i> - if <br> to the end of the task */ drag_link(from: string | number, from_start: boolean, to: string | number, to_start: boolean): string; /** * specifies the CSS class that will be applied to the pop-up that appears when a user drags a link * @param from the id of the source task * @param from_start <i>true</i>, if the link is being dragged from the start of the source task, <i>false</i> - if <br> from the end of the task * @param to the id of the target task( 'null' or 'undefined', if the target task isn't specified yet) * @param to_start <i>true</i>, if the link is being dragged to the start of the target task, <i>false</i> - if <br> to the end of the task */ drag_link_class(from: string | number, from_start: boolean, to: string | number, to_start: boolean): string | void; /** * converts a date object to a date string. Used to send data back to the server * @param date the date which needs formatting */ format_date(date: Date): string; /** * specifies the custom content inserted before the labels of child items in the tree column * @param task the task object */ grid_blank(task: Task): string; /** * specifies the format of dates for the columns that show dates (return the `Date` values) * @param date the date which needs formatting * @param column the name of the column that called the template */ grid_date_format(date: Date, column?: string): string; /** * specifies the icon of child items in the tree column * @param task the task object */ grid_file(task: Task): string; /** * specifies the icon of parent items in the tree column * @param task the task object */ grid_folder(task: Task): string; /** * specifies the CSS class that will be applied to the headers of the table's columns * @param columnName the column's name (as specified in the "name" property of the column object) * @param column column object (as specified in the <i>gantt.config.columns</i> config) */ grid_header_class(columnName: string, column: any): string | void; /** * specifies the indent of the child items in a branch (in the tree column) * @param task the task object */ grid_indent(task: Task): string; /** * specifies the icon of the open/close sign in the tree column * @param task the task object */ grid_open(task: Task): string; /** * specifies the CSS class that will be applied to a grid row * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ grid_row_class(start: Date, end: Date, task: Task): string | void; /** * defines the height of the filled area in the resourceHistogram * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ histogram_cell_allocated(start_date: Date, end_date: Date, resource: any, tasks: Array<Task>, assignments: any[]): number | void; /** * specifies the height of the line that defines the available capacity of the resource * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ histogram_cell_capacity(start_date: Date, end_date: Date, resource: any, tasks: Array<Task>, assignments: any[]): number | void; /** * defines the CSS class which is applied to a cell of the resource panel * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ histogram_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array<Task>, assignments: any[]): string | void; /** * defines the label inside a cell * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to the specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ histogram_cell_label(start_date: Date, end_date: Date, resource: any, tasks: Array<Task>, assignments: any[]): string | number | void; /** * specifies the CSS class that will be applied to a link * @param link the link object */ link_class(link: Link): string | void; /** * specifies the text in the header of the link's "delete" confirm window * @param link the link object */ link_description(link: any): string; /** * converts date string into a Date object * @param date the string which need to be parsed */ parse_date(date: string): Date; /** * specifies the text in the completed part of the task bar * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ progress_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the CSS class that will be applied to the pop-up edit form * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ quick_info_class(start: Date, end: Date, task: Task): string | void; /** * specifies the content of the pop-up edit form * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ quick_info_content(start: Date, end: Date, task: Task): string; /** * specifies the date of the pop-up edit form * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ quick_info_date(start: Date, end: Date, task: Task): string; /** * specifies the title of the pop-up edit form * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ quick_info_title(start: Date, end: Date, task: Task): string | number | void; /** * defines the CSS class names of cells in the resource timeline cells * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ resource_cell_class(start_date: Date, end_date: Date, resource: any, tasks: Array<Task>, assignments: any[]): string | void; /** * defines the HTML content of resource timeline cells * @param start_date start date of the scale cell * @param end_date end date of the scale cell * @param resource the resource object * @param tasks tasks that are assigned to specified resource and overlap start/end dates of the cell * @param assignments resource assignments that are assigned to the specified start/end dates of the task */ resource_cell_value(start_date: Date, end_date: Date, resource: any, tasks: Array<Task>, assignments: any[]): string | number | void; /** * specifies the CSS class that will be applied to cells of the time scale of the timeline area * @param date the date of a cell */ scale_cell_class(date: Date): string | void; /** * specifies the CSS class that will be applied to the time scale * @param scale the scale's configuration object */ scale_row_class(scale: Scale): string | void; /** * specifies the CSS class that will be applied to task bars * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ task_class(start: Date, end: Date, task: Task): string | void; /** * specifies the date format of the label in the 'Time period' section of the lightbox * @param date the date which needs formatting */ task_date(date: Date): string; /** * specifies the format for the end dates of tasks in the lightbox * @param date the date which needs formatting */ task_end_date(date: Date): string; /** * specifies the CSS class that will be applied to the row of the timeline area * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ task_row_class(start: Date, end: Date, task: Task): string | void; /** * specifies the text in the task bars and the header of the lightbox * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ task_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the date period in the header of the lightbox * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ task_time(start: Date, end: Date, task: Task): string; /** * specifies the dates of unscheduled tasks * @param task the task object */ task_unscheduled_time(task: Task): string | void; /** * specifies the format of the drop-down time selector in the lightbox * @param date the date which needs formatting */ time_picker(date: Date): string; /** * specifies the CSS class that will be applied to the cells of the timeline area * @param item either the task's or resource's object assigned to the row * @param date the date of a cell */ timeline_cell_class(item: any, date: Date): string | void; /** * specifies custom HTML content in the timeline cells * @param task the task's object * @param date the date of a cell */ timeline_cell_content(task: Task, date: Date): string | number | void; /** * specifies the format of start and end dates displayed in the tooltip * @param date the date which needs formatting */ tooltip_date_format(date: Date): string; /** * specifies the text of tooltips * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ tooltip_text(start: Date, end: Date, task: Task): string | void; /** * specifies the text assigned to tasks bars on the right side * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ rightside_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the text assigned to tasks bars on the left side * @param start the date when a task is scheduled to begin * @param end the date when a task is scheduled to be completed * @param task the task object */ leftside_text(start: Date, end: Date, task: Task): string | number | void; /** * specifies the lightbox's header * @param start_date the date when a task is scheduled to begin * @param end_date the date when a task is scheduled to be completed * @param task the task's object */ lightbox_header(start_date: Date, end_date: Date, task: Task): string; /** * specifies the CSS class that will be applied to markers * @param marker the marker's configuration object */ marker_class(marker: any): void; [customTemplate: string]: any; } export interface GanttConfigOptions { /** * enables auto scheduling */ auto_scheduling: boolean | AutoSchedulingConfig; /** * disables usage of time contraints for tasks */ auto_scheduling_compatibility: boolean; /** * allows or forbids creating links from parent tasks (projects) to their children */ auto_scheduling_descendant_links: boolean; /** * defines whether gantt will do autoscheduling on data loading/parsing */ auto_scheduling_initial: boolean; /** * defines whether the whole project will be moved (see the details below) */ auto_scheduling_move_projects: boolean; /** * defines whether tasks should inherit the constraint type from their parent project */ auto_scheduling_project_constraint: boolean; /** * enables the auto scheduling mode, in which tasks will always be rescheduled to the earliest possible date */ auto_scheduling_strict: boolean; /** * sets the way the scheduling algorithms process completed tasks */ auto_scheduling_use_progress: boolean; /** * automatically converts tasks with subtasks to projects and projects without subtasks back to tasks */ auto_types: boolean; /** * enables automatic adjusting of the grid's columns to the grid's width */ autofit: boolean; /** * enables autoscrolling while dragging a task or link out of the current browser screen */ autoscroll: boolean; /** * defines the speed of autoscrolling (in ms) while dragging a task or link out of the current browser screen */ autoscroll_speed: number; /** * forces the Gantt chart to automatically change its size to show all tasks without scrolling */ autosize: boolean | string; /** * sets the minimum width (in pixels) that the Gantt chart can take in the horizontal 'autosize' mode */ autosize_min_width: number; /** * sets the height of task bars in the timeline area */ bar_height: number | string; /** * adjusts the padding around task bars in the timeline when `bar_height` is set to "full" */ bar_height_padding: number; /** * configures the functionality of baselines in the Gantt chart */ baselines: BaselineConfig | boolean; /** * enables dynamic loading in the Gantt chart */ branch_loading: boolean; /** * specifies that the task has children that are not yet loaded from the backend */ branch_loading_property: string; /** * stores a collection of buttons resided in the left bottom corner of the lightbox */ buttons_left: string[]; /** * stores a collection of buttons resided in the right bottom corner of the lightbox */ buttons_right: string[]; /** * changes the name of the property that affects binding of a calendar to a task/group of tasks */ calendar_property: string; /** * enables cascade deleting of nested tasks and links */ cascade_delete: boolean; /** * enables advanced drag-n-drop */ click_drag: undefined | ClickDrag; /** * configures the columns of the table */ columns: GridColumn[]; /** * contains all available constraint types * @param As Soon As Possible * @param As Late As Possible * @param Start No Earlier Than * @param Start No Later Than * @param Finish No Earlier Than * @param Finish No Later Than * @param Must Start On * @param Must Finish On */ constraint_types: { ASAP?: string, ALAP?: string, SNET?: string, SNLT?: string, FNET?: string, FNLT?: string, MSO?: string, MFO?: string } /** * defines whether the gantt should track resizing of the container at time intervals */ container_resize_method: string | undefined; /** * specifies the delay (in milliseconds) before redrawing the gantt when resizing the container */ container_resize_timeout: number; /** * enables adjusting the task's start and end dates to the work time (while dragging) */ correct_work_time: boolean; /** * defines internal implementation of the code of date formatting methods */ csp: boolean | string; /** * sets the date format that is used to parse data from a data set and to send dates back to the server */ date_format: string; /** * sets the format of dates in the "Start time" column of the table */ date_grid: string; /** * enables or disables the display of deadline elements for tasks */ deadlines: boolean; /** * defines whether gantt will perform a deep copy of data objects passed into the gantt.parse() method */ deepcopy_on_parse: boolean; /** * 'says' to open the lightbox while creating new events by clicking the '+' button */ details_on_create: boolean; /** * 'says' to open the lightbox after double clicking on a task */ details_on_dblclick: boolean; /** * enables the possibility to drag the lightbox by the header */ drag_lightbox: boolean; /** * enables creating dependency links by drag-and-drop */ drag_links: boolean; /** * stores the types of available drag-and-drop modes * @param the mode when the user drags a task bar to change its duration. * @param the mode when the user drags the progress knob of a task bar. * @param the mode when the user drags a task bar to replace it. * @param the service mode which restricts the drag-and-drop action. */ drag_mode: { resize?: string, progress?: string, move?: string, ignore?: string } /** * enables the possibility to move tasks by drag-and-drop */ drag_move: boolean; /** * enables the possibility to drag several selected tasks at once */ drag_multiple: boolean; /** * enables the possibility to change the task progress by dragging the progress knob */ drag_progress: boolean; /** * enables drag and drop of items of the project type */ drag_project: boolean; /** * enables the possibility to resize tasks by drag-and-drop */ drag_resize: boolean; /** * configures the behavior of the drag_timeline extension * @param CSS selector. Scrolling the timeline won't be activated for the elements that match the selector * @param if the property is specified, scrolling the timeline will be activated only when the specified modifier key is pressed. The supported values are: "ctrlKey", "shiftKey", "metaKey", "altKey" * @param if the property is enabled, scrolling the timeline will be rerendered when the scroll is started and when it is ended */ drag_timeline: null | { ignore?: string, useKey?: string | boolean, render?: boolean } /** * sets the number of 'gantt.config.duration_unit' units that will correspond to one unit of the 'duration' data property. */ duration_step: number; /** * sets the duration unit */ duration_unit: string; /** * enables automatic merging of multiple resource calendars into one */ dynamic_resource_calendars: boolean; /** * changes the name of a property that affects the editing ability of tasks/links in the read-only Gantt chart */ editable_property: string; /** * an object that contains definitions of inline editors * @param for editing text columns, e.g. task name * @param for editing number columns, e.g. task duration, order, etc. * @param for editing duration columns, i.e. task duration. * @param for editing date columns, e.g. start and end dates of the task * @param for choosing an option from a list * @param for setting task-predecessor for the currently edited task. This editor gets the [WBS codes of tasks](desktop/specifying_columns.md#wbscode) to set connection with the predecessor task * @param custom inline editors */ editor_types: { text?: InlineEditor, number?: InlineEditor, duration?: InlineEditor, date?: InlineEditor, select?: InlineEditor, predecessor?: InlineEditor, [customEditorName: string]: InlineEditor | undefined } /** * sets the end value of the time scale */ end_date: Date | undefined; /** * renders an external component into the DOM * @param an object that is returned by the **onrender* function. * @param an object that is returned by the **onrender* function. * @param a DOM element the native component will be attached to. */ external_render: { isElement(element: any): boolean, renderElement(element: any, container: HTMLElement): void } /** * 'says' the Gantt chart to automatically extend the time scale in order to fit all displayed tasks */ fit_tasks: boolean; /** * adjusts the width of columns inside a scrollable grid */ grid_elastic_columns: boolean | string; /** * sets the name of the attribute of the column resizer's DOM element. The attribute presents the column's index */ grid_resizer_column_attribute: string; /** * sets the width of the grid */ grid_width: number; /** * shows the critical path in the chart */ highlight_critical_path: boolean; /** * enables/disables horizontal scroll by the Shift|Alt|Meta key + mouse wheel movement */ horizontal_scroll_key: string | boolean; /** * defines whether tasks should inherit work calendars from their summary parents */ inherit_calendar: boolean; /** * specifies whether sub-scales shall use the scale_cell_class template by default */ inherit_scale_class: boolean; /** * sets whether the timeline area will be initially scrolled to display the earliest task */ initial_scroll: boolean; /** * keeps the duration of a task unchanged during editing of the start/end of a task */ inline_editors_date_processing: string | undefined; /** * defines whether inline editor should be opened after one click on a task when multi-task selection is enabled */ inline_editors_multiselect_open: boolean | undefined; /** * 'says' to preserve the initial grid's width while resizing columns within */ keep_grid_width: boolean; /** * enables keyboard navigation in gantt */ keyboard_navigation: boolean; /** * enables keyboard navigation by cells */ keyboard_navigation_cells: boolean; /** * sets the name of the attribute of the task layer's DOM element */ layer_attribute: string; /** * specifies the layout object */ layout: any; /** * specifies the lightbox object */ lightbox: LightboxSections; /** * increases the height of the lightbox */ lightbox_additional_height: number; /** * sets the size of the link arrow */ link_arrow_size: number; /** * sets the name of the attribute that will specify the id of the link's HTML element */ link_attribute: string; /** * sets the width of dependency links in the timeline area */ link_line_width: number; /** * sets the radius for rounding corners of link lines in the timeline */ link_radius: number; /** * sets the width of the area (over the link) sensitive to clicks */ link_wrapper_width: number; /** * stores the types of links dependencies * @param the target task can't start before the source task ends (but it may start later). * @param the target task can't start until the source task starts (but it may start later). * @param the target task can't end before the source task ends (but it may end later). * @param the target task can't end before the source task starts (but it may end later). */ links: { finish_to_start?: string | number, start_to_start?: string | number, finish_to_finish?: string | number, start_to_finish?: string | number } /** * sets the minimum width for a column in the timeline area */ min_column_width: number; /** * sets the minimum duration (in milliseconds) that can be set for a task during resizing. */ min_duration: number; /** * sets the minimal width for each grid column (in pixels) while resizing grid */ min_grid_column_width: number; /** * sets the minimal row height that can be set for a task during resizing */ min_task_grid_row_height: number; /** * enables/disables multi-task selection in the Gantt chart */ multiselect: boolean; /** * specifies whether multi-task selection will be available within one or any level */ multiselect_one_level: boolean; /** * ena