Skip to content

Commit b84bcf2

Browse files
Merge pull request #110 from AlexKlimenkov/next
v10.0
2 parents d223946 + e033d29 commit b84bcf2

93 files changed

Lines changed: 2649 additions & 1557 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# DHTMLX Gantt Documentation
2+
3+
Documentation for the DHTMLX Gantt library lives here.
4+
5+
Always read/write files as UTF-8 without BOM.
6+
7+
Do not run `docusaurus build` to verify docs unless directly asked or unless it is clearly necessary. The build process may take up to 10-15 minutes. You can build a specific locale using the `--locale` parameter with a language code, e.g. `docusaurus build --locale en`.
8+
9+
For cross-article links in docs, use markdown file paths relative to the `docs` folder, not URL paths or paths relative to the current article, e.g. `[copyright](guides/copyright.md)`. These links are transformed to URL path links during build (`local_modules/dhx-md-data-parser/index.js`). For pages stored as `index.md`, do not include `/index.md`; use the generated article path format expected by the parser - e.g. bad: `[react](integrations/react/index.md)`, good: `[react](integrations/react.md)`.
10+
11+
If a page is deleted or its slug changes, add redirects from the old URL to `docker/redirects.conf` for the English version and all translations.
12+
13+
When editing docs/specs/prose, preserve the existing structure and wording unless the requested change requires otherwise. Prefer small targeted patches over full rewrites.
14+
15+
`llms.txt` and the markdown version of the documentation are generated from the content of `docs` during build and are located in the `static` folder. Do not modify `static/llms-md` and `static/llms.txt` directly. To modify `llms.txt` or the markdown version of docs, refer to the `gantt-docs\plugins\dhx-llms-plugin\index.js` plugin.
16+
17+
Translations live in the `i18n` folder. They are updated on a semi-regular basis and can be modified directly; direct changes are not expected to be lost during re-translation.

docs/api/config/auto_scheduling.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,23 @@ gantt.init("gantt_here");
262262

263263
- [Constraint Scheduling](https://docs.dhtmlx.com/gantt/samples/02_extensions/19_constraints_scheduling.html)
264264

265+
#### strict_calendar
266+
267+
**Type**: boolean
268+
269+
**Default**: `false`
270+
271+
Controls whether a task landing on its own non-working time is reported as a conflict.
272+
273+
~~~jsx
274+
gantt.config.auto_scheduling = {
275+
enabled: true,
276+
strict_calendar: true
277+
};
278+
~~~
279+
280+
When set to `true`, the [onAutoScheduleConflict](api/event/onautoscheduleconflict.md) event fires (with `kind: "calendar-non-working"`) whenever scheduling moves a task onto its own non-working time. The task date is applied in both modes - this option only controls whether the situation is reported, so you can surface it in the UI.
281+
265282
### Related API
266283
- [project_start](api/config/project_start.md)
267284
- [project_end](api/config/project_end.md)
@@ -280,11 +297,14 @@ gantt.init("gantt_here");
280297
- [onBeforeTaskAutoSchedule](api/event/onbeforetaskautoschedule.md)
281298
- [onCircularLinkError](api/event/oncircularlinkerror.md)
282299
- [onAutoScheduleCircularLink](api/event/onautoschedulecircularlink.md)
300+
- [onAutoScheduleConflict](api/event/onautoscheduleconflict.md)
301+
- [onAutoScheduleNoConverge](api/event/onautoschedulenoconverge.md)
283302

284303
### Related Guides
285304
- [Auto Scheduling](guides/auto-scheduling.md)
286305

287306
### Change log
307+
- the `strict_calendar` option has been added in v10.0
288308
- since v9.1, using the object configuration for `auto_scheduling` is the recommended approach
289309
- Can be set as an object since v9.0
290310

docs/api/config/layout.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ description: "specifies the layout object"
1616

1717
~~~jsx
1818
gantt.config.layout = {
19-
css: "gantt_container",
20-
rows:[
19+
css: "gantt_container",
20+
rows: [
2121
{
22-
cols: [
23-
{view: "grid", id: "grid", scrollX:"scrollHor", scrollY:"scrollVer"},
24-
{resizer: true, width: 1},
25-
{view: "timeline", id: "timeline", scrollX:"scrollHor", scrollY:"scrollVer"},
26-
{view: "scrollbar", scroll: "y", id:"scrollVer"}
27-
]
28-
},
29-
{view: "scrollbar", scroll: "x", id:"scrollHor", height:20}
30-
]
22+
cols: [
23+
{ view: "grid", id: "grid", scrollX: "scrollHor", scrollY: "scrollVer" },
24+
{ resizer: true, width: 1 },
25+
{ view: "timeline", id: "timeline", scrollX: "scrollHor", scrollY: "scrollVer" },
26+
{ view: "scrollbar", scroll: "y", id: "scrollVer" }
27+
]
28+
},
29+
{ view: "scrollbar", scroll: "x", id: "scrollHor", height: 20 }
30+
]
3131
};
3232

3333
gantt.init("gantt_here");
@@ -36,7 +36,7 @@ gantt.init("gantt_here");
3636
### Details
3737

3838
:::note
39-
Note that you should specify the configuration of layout before Gantt initialization. If you make changes in the layout, you need to refresh it using [resetLayout](api/method/resetlayout.md).
39+
Note that you should specify the layout configuration before Gantt initialization. If you make changes to the layout, you need to refresh it using [`resetLayout()`](api/method/resetlayout.md).
4040
:::
4141

4242
### Related API
@@ -46,4 +46,3 @@ Note that you should specify the configuration of layout before Gantt initializa
4646
- [Gantt Layout](guides/layout-config.md)
4747
- [How-tos](guides/how-to.md#how-to-toggle-gridchart) (read how to toggle grid/chart)
4848
- [How-tos](guides/how-to.md#how-to-toggle-the-resource-view) (read how to toggle the resource view)
49-

docs/api/config/links.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ description: "stores the types of links dependencies"
1515
### Example
1616

1717
~~~jsx
18-
var type1 = gantt.config.links.finish_to_start;
18+
const finishToStartType = gantt.config.links.finish_to_start;
1919
~~~
2020

21-
**Default value:**\{ "finish_to_start":"0", "start_to_start":"1", "finish_to_finish":"2", "start_to_finish":"3" \}
21+
**Default value:** `{ "finish_to_start":"0", "start_to_start":"1", "finish_to_finish":"2", "start_to_finish":"3" }`
2222

2323
### Details
2424

2525
- **finish_to_start** - (*string | number*) - the target task can't start before the source task ends (but it may start later).
2626
- **start_to_start** - (*string | number*) - the target task can't start until the source task starts (but it may start later).
27-
- **finish_to_finish** - (*string | number*) - the target task can't end before the source task ends (but it may end later).
27+
- **finish_to_finish** - (*string | number*) - the target task can't end before the source task ends (but it may end later).
2828
- **start_to_finish** - (*string | number*) - the target task can't end before the source task starts (but it may end later).
2929

3030
### Related Guides

docs/api/config/start_date.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,37 @@ description: "sets the start value of the time scale"
1515
### Example
1616

1717
~~~jsx
18-
gantt.config.start_date = new Date(2018, 08, 10);
19-
gantt.config.end_date = new Date(2018, 08, 20);
20-
18+
gantt.config.start_date = new Date(2027, 8, 10);
19+
gantt.config.end_date = new Date(2027, 8, 20);
20+
2121
gantt.init("gantt_here");
2222
~~~
2323

2424
### Details
2525

2626
:::note
27-
To apply the **start_date** option, you must use it in pair with the [end_date](api/config/end_date.md) one.
27+
To apply the `start_date` option, you must use it together with [end_date](api/config/end_date.md).
2828
:::
2929

30-
- If both the **start_date** and **end_date** options are specified and you create a task that is outside the range, the task will disappear from the chart.
31-
- Optional parameters of the [init](api/method/init.md) method can be used as initial values of [start_date](api/config/start_date.md) and [end_date](api/config/end_date.md).
30+
- If both the [start_date](api/config/start_date.md) and [end_date](api/config/end_date.md) options are specified and you create a task outside that range, the task will disappear from the chart.
31+
- Optional parameters of [`init()`](api/method/init.md) can be used as initial values of [start_date](api/config/start_date.md) and [end_date](api/config/end_date.md).
3232
- [start_date](api/config/start_date.md) and [end_date](api/config/end_date.md) overwrite [fit_tasks](api/config/fit_tasks.md). If you want to use these settings together, you'll need to [manage the time scale from code](guides/configuring-time-scale.md#range).
3333

3434
In this case we can extend the range:
3535

3636
~~~js
37-
gantt.attachEvent("onLightboxSave", function(id, task, is_new){
38-
var taskStart = task.start_date;
39-
var taskEnd = task.end_date;
40-
var scaleStart = gantt.config.start_date;
41-
var scaleEnd = gantt.config.end_date;
42-
43-
// if the task is out of the range
44-
if(scaleStart > taskEnd || scaleEnd taskEnd || scaleEnd < taskStart ){
45-
gantt.message({
46-
type:"warning",
47-
text:"Warning! The task is outside the date range!",
48-
expire:5000
49-
});
50-
return false;
51-
}
37+
gantt.attachEvent("onLightboxSave", (taskId, task, isNew) => {
38+
const taskStartDate = task.start_date;
39+
const taskEndDate = task.end_date;
40+
const scaleStartDate = gantt.config.start_date;
41+
const scaleEndDate = gantt.config.end_date;
42+
43+
if (scaleStartDate > taskEndDate || scaleEndDate < taskStartDate) {
44+
gantt.message({ type: "warning", text: "Warning! The task is outside the date range!", expire: 5000 });
45+
46+
return false;
47+
}
48+
5249
return true;
5350
});
5451
~~~
@@ -61,4 +58,3 @@ gantt.attachEvent("onLightboxSave", function(id, task, is_new){
6158

6259
### Related Guides
6360
- [Setting up Scale](guides/configuring-time-scale.md)
64-

docs/api/event/onaftertaskdrag.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,23 @@ description: "fires after the user has finished to drag and released the mouse b
1414

1515
### Parameters
1616

17-
- `id` - (required) *string | number* - the task id
17+
- `id` - (required) *string | number* - the task ID
1818
- `mode` - (required) *string* - the drag-and-drop mode ("resize", "progress", "move", "ignore")
1919
- `e` - (required) *Event* - a native event object
2020

2121
### Example
2222

2323
~~~jsx
24-
gantt.attachEvent("onAfterTaskDrag", function(id, mode, e){
24+
gantt.attachEvent("onAfterTaskDrag", (id, mode, e) => {
2525
//any custom logic here
2626
});
2727
~~~
2828

2929
### Details
3030

31-
The event fires when the user drags a task in the timeline area.
31+
The event fires after the user drags a task in the timeline area.
3232

3333
### Related API
3434
- [drag_mode](api/config/drag_mode.md)
3535
- [onBeforeTaskDrag](api/event/onbeforetaskdrag.md)
3636
- [onBeforeTaskChanged](api/event/onbeforetaskchanged.md)
37-
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
sidebar_label: onAutoScheduleConflict
3+
title: onAutoScheduleConflict event
4+
description: "fires for each conflict found during auto scheduling"
5+
---
6+
7+
# onAutoScheduleConflict
8+
:::info
9+
This functionality is available in the PRO edition only.
10+
:::
11+
### Description
12+
13+
@short: Fires for each conflict found during auto scheduling
14+
15+
@signature: onAutoScheduleConflict: (conflict: object) =\> void;
16+
17+
### Parameters
18+
19+
- `conflict` - (required) *object* - the conflict found during scheduling. The set of fields depends on the conflict `kind`.
20+
21+
### Example
22+
23+
~~~jsx
24+
gantt.attachEvent("onAutoScheduleConflict", function(conflict){
25+
if (conflict.kind === "constraint-violation") {
26+
console.warn(`Task ${conflict.taskId}: the ${conflict.constraintType} constraint could not be satisfied`);
27+
}
28+
});
29+
~~~
30+
31+
### Related samples
32+
- [Auto Scheduling extension](https://docs.dhtmlx.com/gantt/samples/02_extensions/12_auto_scheduling.html)
33+
34+
### Details
35+
36+
:::note
37+
This event is defined in the **auto_scheduling** extension, so you need to activate the [auto_scheduling](guides/extensions-list.md#autoscheduling) plugin. Read the details in the [Auto Scheduling](guides/auto-scheduling.md) article.
38+
:::
39+
40+
The event fires once for every conflict that auto scheduling runs into. Auto scheduling still produces a result - the event lets you surface the conflicts in the UI or react to them.
41+
42+
The `conflict.kind` field defines the type of the conflict and the available fields:
43+
44+
| `kind` | Description | Fields |
45+
|---|---|---|
46+
| `"constraint-violation"` | A task's constraint could not be satisfied at its scheduled position. | `taskId`, `constraintType`, `required` *(Date)*, `actual` *(Date)* |
47+
| `"calendar-non-working"` | A task landed on its own non-working time. Reported only when [strict_calendar](api/config/auto_scheduling.md#strict_calendar) is enabled. | `taskId`, `proposedDate` *(Date)*, `snappedDate` *(Date)* |
48+
| `"unscheduled-dependency"` | A task depends on a task that is not scheduled. | `taskId`, `blockedBy` |
49+
50+
Dependency loops are reported through the separate [onAutoScheduleCircularLink](api/event/onautoschedulecircularlink.md) event, not here.
51+
52+
### Related API
53+
- [auto_scheduling](api/config/auto_scheduling.md)
54+
- [auto_scheduling_move_projects](api/config/auto_scheduling_move_projects.md)
55+
- [auto_scheduling_use_progress](api/config/auto_scheduling_use_progress.md)
56+
- [findCycles](api/method/findcycles.md)
57+
- [isCircularLink](api/method/iscircularlink.md)
58+
- [onAfterAutoSchedule](api/event/onafterautoschedule.md)
59+
- [onAfterTaskAutoSchedule](api/event/onaftertaskautoschedule.md)
60+
- [onBeforeAutoSchedule](api/event/onbeforeautoschedule.md)
61+
- [onBeforeTaskAutoSchedule](api/event/onbeforetaskautoschedule.md)
62+
- [onAutoScheduleCircularLink](api/event/onautoschedulecircularlink.md)
63+
- [onAutoScheduleNoConverge](api/event/onautoschedulenoconverge.md)
64+
65+
### Related Guides
66+
- [Auto Scheduling](guides/auto-scheduling.md)
67+
68+
### Change log
69+
- added in version 10.0
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
sidebar_label: onAutoScheduleNoConverge
3+
title: onAutoScheduleNoConverge event
4+
description: "fires when auto scheduling cannot settle on a stable result"
5+
---
6+
7+
# onAutoScheduleNoConverge
8+
:::info
9+
This functionality is available in the PRO edition only.
10+
:::
11+
### Description
12+
13+
@short: Fires when auto scheduling cannot settle on a stable result
14+
15+
@signature: onAutoScheduleNoConverge: (result: object) =\> void;
16+
17+
### Parameters
18+
19+
- `result` - (required) *object* - details of the scheduling run, including the number of `iterations` performed and the list of `conflicts` collected.
20+
21+
### Example
22+
23+
~~~jsx
24+
gantt.attachEvent("onAutoScheduleNoConverge", function(result){
25+
console.warn("Auto scheduling did not converge", result.conflicts);
26+
});
27+
~~~
28+
29+
### Related samples
30+
- [Auto Scheduling extension](https://docs.dhtmlx.com/gantt/samples/02_extensions/12_auto_scheduling.html)
31+
32+
### Details
33+
34+
:::note
35+
This event is defined in the **auto_scheduling** extension, so you need to activate the [auto_scheduling](guides/extensions-list.md#autoscheduling) plugin. Read the details in the [Auto Scheduling](guides/auto-scheduling.md) article.
36+
:::
37+
38+
Auto scheduling places tasks in repeated passes until the result stops changing. This event fires when the result keeps changing and the engine stops after a number of passes without reaching a stable state. In practice this points to an over-constrained project - for example, a set of constraints and dependencies that cannot all be satisfied at the same time.
39+
40+
The `result` parameter contains the details of the run:
41+
42+
- `iterations` - *number* - how many passes were performed.
43+
- `converged` - *boolean* - `false` in this event.
44+
- `conflicts` - *array* - the conflicts collected during scheduling (see [onAutoScheduleConflict](api/event/onautoscheduleconflict.md) for the conflict fields).
45+
46+
### Related API
47+
- [auto_scheduling](api/config/auto_scheduling.md)
48+
- [auto_scheduling_move_projects](api/config/auto_scheduling_move_projects.md)
49+
- [auto_scheduling_use_progress](api/config/auto_scheduling_use_progress.md)
50+
- [findCycles](api/method/findcycles.md)
51+
- [isCircularLink](api/method/iscircularlink.md)
52+
- [onAfterAutoSchedule](api/event/onafterautoschedule.md)
53+
- [onAfterTaskAutoSchedule](api/event/onaftertaskautoschedule.md)
54+
- [onBeforeAutoSchedule](api/event/onbeforeautoschedule.md)
55+
- [onBeforeTaskAutoSchedule](api/event/onbeforetaskautoschedule.md)
56+
- [onAutoScheduleCircularLink](api/event/onautoschedulecircularlink.md)
57+
- [onAutoScheduleConflict](api/event/onautoscheduleconflict.md)
58+
59+
### Related Guides
60+
- [Auto Scheduling](guides/auto-scheduling.md)
61+
62+
### Change log
63+
- added in version 10.0

docs/api/event/ontaskclick.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,24 @@ description: "fires when the user clicks on a task row in the grid area (includi
1414

1515
### Parameters
1616

17-
- `id` - (required) *string | number* - the id of the clicked task
17+
- `id` - (required) *string | number* - the ID of the clicked task
1818
- `e` - (optional) *Event* - a native event object
1919

2020
### Returns
21-
- ` result` - (boolean) - defines whether the default action of the event will be triggered (<b>true</b>) or canceled (<b>false</b>)
21+
- `result` - (boolean) - defines whether the default action of the event will be triggered (<b>true</b>) or canceled (<b>false</b>)
2222

2323
### Example
2424

2525
~~~jsx
26-
gantt.attachEvent("onTaskClick", function(id,e){
26+
gantt.attachEvent("onTaskClick", (id, e) => {
2727
//any custom logic here
2828
return true;
2929
});
3030
~~~
3131

3232
### Details
3333

34-
The event is blockable. Returning false will cancel the default handler (selecting a task)
34+
The event is blockable. Returning `false` will cancel the default handler, which selects a task.
3535

3636
### Related API
3737
- [onTaskDblClick](api/event/ontaskdblclick.md)
38-

0 commit comments

Comments
 (0)