Skip to content

Commit c148947

Browse files
authored
Merge pull request #36 from DHTMLX/next-v9.0.1
[update] examples for treecollection filter(), getFilters()
2 parents a1ff62e + f90c08e commit c148947

File tree

3 files changed

+41
-10
lines changed

3 files changed

+41
-10
lines changed

docs/pagination/init.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ Add two containers:
8585

8686
## Initialize a related widget
8787

88-
{{note DHTMLX Pagination can be used in conjunction with data components like [List](list.md), [DataView](dataview.md), [Tree](tree.md), [Grid](grid.md), or [TreeGrid](/grid/treegrid_mode/).}}
88+
:::note
89+
DHTMLX Pagination can be used in conjunction with data components like [List](list.md), [DataView](dataview.md), [Tree](tree.md), [Grid](grid.md), or [Grid in the TreeGrid mode](/grid/treegrid_mode/).
90+
:::
8991

9092
Choose the widget you want to link to the Pagination component, for example, DHTMLX List.
9193

9294
1\. Initialize the widget with the object constructor, like this:
9395

94-
~~~js title="index.js"
96+
~~~jsx title="index.js"
9597
// creating a related DHTMLX List widget
9698
const widget = new dhx.List("widget_container", {
9799
css: "dhx_widget--bordered",
@@ -106,7 +108,7 @@ The constructor has two parameters:
106108

107109
2\. Load data into the widget:
108110

109-
~~~js title="index.js"
111+
~~~jsx title="index.js"
110112
// loading data into the created DHTMLX List
111113
widget.data.parse(widget_data);
112114
~~~
@@ -118,7 +120,7 @@ Initialize pagination with the *dhx.Pagination* object constructor. The construc
118120
- the HTML container for Pagination,
119121
- optional, an object with configuration properties. If this argument is not passed to the constructor, the settings will be default.
120122

121-
~~~js title="index.js"
123+
~~~jsx title="index.js"
122124
// creating DHTMLX Pagination
123125
const pagination = new dhx.Pagination("pagination_container", {
124126
css: "dhx_widget--bordered",

docs/tree_collection/api/treecollection_filter_method.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,38 @@ description: You can explore the filter method of TreeCollection in the document
3030
@returns:
3131
- `id: string` - the id of the filter
3232

33-
@example:
33+
#### Example:
34+
35+
~~~jsx
36+
const grid = new dhx.Grid("grid_container", {
37+
type: "tree",
38+
columns: [
39+
// columns config
40+
],
41+
data: dataset,
42+
});
43+
3444
// filtering data by a function
35-
tree.data.filter(function (item) {
45+
grid.data.filter(function (item) {
3646
return item.value.toLowerCase().indexOf("a") !== -1;
3747
});
48+
~~~
49+
50+
~~~jsx
51+
const grid = new dhx.Grid("grid_container", {
52+
type: "tree",
53+
columns: [
54+
// columns config
55+
],
56+
data: dataset,
57+
});
3858

39-
// filtering data by the column
40-
treeGrid.data.filter({
59+
// filtering data by the column
60+
grid.data.filter({
4161
by: "name",
4262
match: "Angola"
4363
});
64+
~~~
4465

4566
@descr:
4667

docs/tree_collection/api/treecollection_getfilters_method.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,17 @@ description: You can explore the getFilters method of TreeCollection in the docu
1515
- `permanent: boolean` - optional, <i>false</i> by default. Allows getting the list of permanent filters
1616

1717
@returns:
18-
- `filters: object` - an object with the applied filters, where the key is the id of a filter and the value is an object with the [**rule** and **config** properties](tree_collection/api/treecollection_filter_method.md)
18+
- `filters: object` - an object with the applied filters, where the key is the id of a filter and the value is an object with the [`rule` and `config` properties](tree_collection/api/treecollection_filter_method.md)
1919

2020
@example:
21-
const filters = treegrid.data.getFilters();
21+
const grid = new dhx.Grid("grid_container", {
22+
type: "tree",
23+
columns: [
24+
// columns config
25+
],
26+
data: dataset,
27+
});
28+
29+
grid.data.getFilters();
2230

2331
@descr:

0 commit comments

Comments
 (0)