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+"']");
0 commit comments