You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/config/autosize.md
+34-35Lines changed: 34 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,70 +24,69 @@ gantt.init("gantt_here");
24
24
25
25
### Details
26
26
27
-
The 'autosize' config defines whether the gantt will fit data inside the sizes of container where it's initialized showing inner scrollbars,
28
-
or modify the sizes of container in order to show all data without inner scrolls:
27
+
The `autosize` config defines whether the Gantt will fit data inside the size of the container where it's initialized and show inner scrollbars,
28
+
or modify the size of the container in order to show all data without inner scrolls:
29
29
30
-
-[a sample with sizes of gantt div defined in css ](https://snippet.dhtmlx.com/5/b4d4d1b80) - inner scrollbars are active if necessary
31
-
-[a sample with sizes of gantt div calculated by a component](https://snippet.dhtmlx.com/5/c278b3859) - inner scrollbars are disabled
30
+
-[a sample with sizes of Gantt div defined in CSS](https://snippet.dhtmlx.com/2m48u5oz) - inner scrollbars are active if necessary
31
+
-[a sample with sizes of Gantt div calculated by a component](https://snippet.dhtmlx.com/syzmiqwt) - inner scrollbars are disabled
32
32
33
-
In case gantt should fit a certain area on a page, the size of gantt container must be managed manually:
33
+
In case Gantt should fit a certain area on a page, the size of the Gantt container must be managed manually:
34
34
35
-
- autosizing should be disabled
36
-
- width/height of a div should be calculated either by html layout if some ready solution for responsive layouts is used, or manually by code.
35
+
- autosizing should be disabled
36
+
- width/height of a div should be calculated either by HTML layout if some ready solution for responsive layouts is used, or manually by code
37
37
38
-
## Scrolling to hidden elements
38
+
## Scrolling to hidden elements
39
39
40
-
In the default mode, Gantt is scrolled automatically when you use the [showTask](api/method/showtask.md) or [showDate](api/method/showdate.md) method.
41
-
But, when **autosize** is enabled, Gantt increases the size of its container to show itself on the page instead of showing the hidden element.
40
+
In the default mode, Gantt is scrolled automatically when you use the [`showTask()`](api/method/showtask.md) or [`showDate()`](api/method/showdate.md) method.
41
+
But, when `autosize` is enabled, Gantt increases the size of its container to show itself on the page instead of showing the hidden element.
42
42
43
43
There is no any universal way to escape the problem because the page can also include other elements except for Gantt, and some of the elements also need to be scrolled. Therefore, this problem should be solved depending on the page/application configuration.
44
44
45
45
In a *simple* configuration, Gantt may be located before or after some elements in your application. And it can work correctly if you scroll the page.
46
46
47
-
In a *complex* configuration, the Gantt container can be placed into other containers which can also be placed in some other containers.
48
-
In this case, you need to manually scroll only the elements you need.
47
+
In a *complex* configuration, the Gantt container can be placed into other containers which can also be placed in some other containers.
48
+
In this case, you need to manually scroll only the elements you need.
49
49
50
-
One of the ways to make the page to be scrolled to the necessary element is use the **element.scrollIntoView** method:
50
+
One of the ways to make the page scroll to the necessary element is to use the `element.scrollIntoView()` method:
51
51
52
52
~~~js
53
-
var attr=gantt.config.task_attribute;
54
-
var timelineElement =document.querySelector(".gantt_task_line["+attr+"='"+id+"']");
Copy file name to clipboardExpand all lines: docs/api/config/date_format.md
+10-17Lines changed: 10 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,27 +25,23 @@ gantt.load("/data/tasks");
25
25
26
26
### Details
27
27
28
-
This config value is used to generate [parse_date](api/template/parse_date.md) and [format_date](api/template/format_date.md) template functions.
29
-
If you want to use a custom format, you can either change this config, or redefine **parse_date** and **format_date** templates directly.
28
+
This config value is used to generate [`parse_date`](api/template/parse_date.md) and [`format_date`](api/template/format_date.md) template functions.
29
+
If you want to use a custom format, you can either change this config, or redefine `parse_date` and `format_date` templates directly.
30
30
31
31
## Loading dates in ISO format
32
32
33
-
Since v9.1.3, Gantt automatically detects and parses ISO 8601 date strings. The `date_format` config is not needed for ISO strings - they are recognized and parsed directly.
33
+
Since v9.1.3, Gantt automatically detects and parses ISO 8601 date strings. The `date_format` config is not needed for ISO strings - they are recognized and parsed directly.
34
34
35
-
When ISO dates are detected on input, they are serialized back as ISO strings automatically when passed to the [DataProcessor](guides/server-side.md). Date-only strings (e.g., `"2026-01-06"`) are serialized back as date-only strings, preserving the original format.
35
+
When ISO dates are detected on input, they are serialized back as ISO strings automatically when passed to the [DataProcessor](api/method/dataprocessor.md). Date-only strings (e.g., `"2026-01-06"`) are serialized back as date-only strings, preserving the original format.
36
36
37
37
The `date_format` config still applies to non-ISO date strings.
38
38
39
39
:::tip Gantt v9.1.2 and earlier
40
40
In versions before v9.1.3, ISO dates were not detected automatically. If you are using an older version, you need to override `parse_date` and `format_date` templates to handle ISO strings:
@@ -54,15 +50,13 @@ For more details, see [Loading dates in ISO format](guides/loading.md#loading-da
54
50
55
51
## Changing the date format dynamically
56
52
57
-
If you need to change the date format dynamically, it is necessary to modify the [parse_date](api/template/parse_date.md) template in the following way:
53
+
If you need to change the date format dynamically, it is necessary to modify the [`parse_date`](api/template/parse_date.md) template in the following way:
Copy file name to clipboardExpand all lines: docs/api/method/updatetask.md
+29-33Lines changed: 29 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,65 +20,62 @@ description: "updates the specified task"
20
20
### Example
21
21
22
22
~~~jsx
23
-
var taskId =gantt.addTask({
24
-
id:10,
25
-
text:"Task #10",
26
-
start_date:"02-04-2013",
27
-
duration:8,
28
-
parent:1
23
+
consttaskId=gantt.addTask({
24
+
id:10,
25
+
text:"Task #10",
26
+
start_date:"2027-04-02",
27
+
duration:8,
28
+
parent:1
29
29
});
30
30
31
-
gantt.getTask(taskId).text="Task #13"; //changes task's data
32
-
gantt.updateTask(taskId); //renders the updated task
31
+
gantt.getTask(taskId).text="Task #13"; //changes task data
32
+
gantt.updateTask(taskId); //renders the updated task
33
33
~~~
34
34
35
35
### Details
36
36
37
37
:::note
38
-
The method invokes the [onAfterTaskUpdate](api/event/onaftertaskupdate.md) event.
38
+
The method invokes the [`onAfterTaskUpdate`](api/event/onaftertaskupdate.md) event.
39
39
:::
40
40
41
41
:::note
42
-
The method triggers the [DataProcessor](guides/server-side.md) if the dataProcessor is enabled.
42
+
The method triggers the [DataProcessor](api/method/dataprocessor.md) if the dataProcessor is enabled.
43
43
:::
44
44
45
45
This method should be called after modifying the task object to update the Gantt's state, repaint related UI elements, and send the changes to the backend.
46
46
47
-
Calling this method will fire the [onAfterTaskUpdate](api/event/onaftertaskupdate.md) event, which may trigger additional recalculations.
47
+
Calling this method will fire the [`onAfterTaskUpdate`](api/event/onaftertaskupdate.md) event, which may trigger additional recalculations.
48
48
49
-
If you're using the [DataProcessor](guides/server-side.md), invoking this method will prompt an **update** request to the server.
49
+
If you're using the [DataProcessor](api/method/dataprocessor.md), invoking this method will prompt an **update** request to the server.
50
50
51
-
For making visual changes that don't require saving, **use the [refreshTask](api/method/refreshtask.md) method instead**. This will repaint the task without invoking extra calculations.
51
+
For making visual changes that don't require saving, **use the [`refreshTask()`](api/method/refreshtask.md) method instead**. This will repaint the task without invoking extra calculations.
0 commit comments