Skip to content

Commit fcae97b

Browse files
Merge pull request #65 from mlakatkou/GS-3306
[update] init article
2 parents ab52c40 + c88c9b4 commit fcae97b

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

docs/api/method/init.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description: "initializes a dhtmlxGantt inside a container"
1414

1515
### Parameters
1616

17-
- `container` - (required) *string* - | HTMLElement an HTML container (or its id) where a dhtmlxGantt object will be initialized
17+
- `container` - (required) *string* - | HTMLElement an HTML container (or its id) where a dhtmlxGantt object will be initialized
1818

1919
### Example
2020

@@ -28,36 +28,36 @@ gantt.load("tasks.json");
2828

2929
### Details
3030

31-
Using the 2nd and 3rd parameters of the method is a good way to set the boundary values of the time scale:
31+
Using the 2nd and 3rd parameters of `init()` is a good way to set the boundary values of the time scale:
3232

3333
~~~js
34-
gantt.init("gantt_here", new Date(2023, 08, 10), new Date(2023, 08, 20));
34+
gantt.init("gantt_here", new Date(2027, 8, 10), new Date(2027, 8, 20));
3535
~~~
3636

37-
Note, that date paremeters of the `gantt.init` method are shortcuts for [start_date](api/config/start_date.md) and [end_date](api/config/end_date.md) configs.
37+
Note that the date parameters of `init()` are shortcuts for the [start_date](api/config/start_date.md) and [end_date](api/config/end_date.md) configs.
3838
The two code snippets below are equivalent to each other:
3939

4040
~~~js
41-
gantt.init("gantt_here", new Date(2023, 08, 10), new Date(2023, 08, 20));
41+
gantt.init("gantt_here", new Date(2027, 8, 10), new Date(2027, 8, 20));
4242
~~~
4343

4444
and
4545

4646
~~~js
47-
gantt.config.start_date = new Date(2023, 08, 10);
48-
gantt.config.end_date = new Date(2023, 08, 20);
47+
gantt.config.start_date = new Date(2027, 8, 10);
48+
gantt.config.end_date = new Date(2027, 8, 20);
4949
gantt.init("gantt_here");
5050
~~~
5151

5252
What these configs do is define and limit the displayed date range. Tasks that fall outside that specified range won't be displayed.
5353

54-
Using the date parameters of the `gantt.init` method, as well as [start_date](api/config/start_date.md) and [end_date](api/config/end_date.md) configs will cancel the
54+
Using the date parameters of `init()`, as well as the [start_date](api/config/start_date.md) and [end_date](api/config/end_date.md) configs, will cancel the
5555
[fit_tasks](api/config/fit_tasks.md) setting.
5656

5757
If you want the time scale to be dynamically adjusted according to the date range, you can either skip these parameters or [manage the time range dynamically](guides/configuring-time-scale.md#range).
5858

5959
:::note
60-
This method resets custom layers added to the timeline area via the [addTaskLayer](api/method/addtasklayer.md) and [addLinkLayer](api/method/addlinklayer.md) methods. Therefore, you need to redefine these ones after calling the **gantt.init** method in order for custom layers to be displayed on a page.
60+
This method resets custom layers added to the timeline area via the [`addTaskLayer()`](api/method/addtasklayer.md) and [`addLinkLayer()`](api/method/addlinklayer.md) methods. Therefore, you need to redefine them after calling `init()` for custom layers to be displayed on a page.
6161
:::
6262

6363
### Related API
@@ -67,4 +67,3 @@ This method resets custom layers added to the timeline area via the [addTaskLaye
6767

6868
### Related Guides
6969
- [dhtmlxGantt in Plain JS/HTML](guides/initializing-gantt-chart.md)
70-

0 commit comments

Comments
 (0)