Skip to content

Commit 710a815

Browse files
authored
Merge pull request #48 from DHTMLX/next
[add] docs for v9.1
2 parents e5aa17c + 3c22aae commit 710a815

44 files changed

Lines changed: 1235 additions & 384 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
21.7 KB
Loading
55.6 KB
Loading
77.7 KB
Loading

docs/assets/grid/row_expander.png

51.7 KB
Loading
38.2 KB
Loading

docs/data_collection/api/datacollection_filter_method.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ description: You can explore the filter method of DataCollection in the document
1414
- `rule: function | object` - the filtering criteria
1515
- If set as a *function*, filtering will be applied by the rule specified in the function. The function takes an object of a data item as a parameter and returns *true/false*
1616
- If set as an *object*, the parameter has the following attributes:
17-
- `by: string | number` - mandatory, the id of a data field (the column of Grid)
17+
- `by: string | number` - mandatory, the id of a data field
1818
- `match: string` - mandatory, a pattern to match
1919
- `compare: function` - optional, a function for extended filtering that takes three parameters:
20-
- `value` - the value to compare (e.g. a column in a row for Grid)
20+
- `value` - the value to compare
2121
- `match` - a pattern to match
22-
- `item` - a data item the values of which should be compared (e.g. a row)
22+
- `item` - a data item the values of which should be compared
2323
- `config: object` - optional, defines the parameters of filtering. It may contain the following properties:
2424
- `id: string` - optional, the id of the filter
2525
- `add: boolean` - optional, defines whether each next filtering will be applied to the already filtered data (<i>true</i>), or to the initial data (<i>false</i>, default)

docs/data_collection/api/datacollection_getfilters_method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ description: You can explore the getFilters method of DataCollection 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](data_collection/api/datacollection_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](data_collection/api/datacollection_filter_method.md)
1919

2020
@example:
2121
const filters = grid.data.getFilters();
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
sidebar_label: getSortingStates()
3+
title: JavaScript DataCollection - getSortingStates Method
4+
description: You can explore the getSortingStates method of DataCollection in the documentation of the DHTMLX JavaScript UI library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Suite.
5+
---
6+
7+
# getSortingStates()
8+
9+
@short: returns an array of objects with the current parameters of sorting applied to the data
10+
11+
## Usage
12+
13+
~~~jsx
14+
interface ISortingState {
15+
by: string | number,
16+
dir: "asc" | "desc",
17+
as?: (a) => any,
18+
rule?: (a, b) => number,
19+
smartSorting?: boolean
20+
}
21+
22+
getSortingStates(): ISortingState[];
23+
~~~
24+
25+
@returns:
26+
An array of objects with the current parameters of sorting applied to the data.
27+
28+
@example:
29+
const state = grid.data.getSortingStates();
30+
// -> [{by: "country", dir: "desc"}, {by: "population", dir: "desc"}]
31+
32+
@descr:
33+
The array returned by the method contains objects with the following properties:
34+
35+
<table>
36+
<tbody>
37+
<tr>
38+
<td><b>by</b></td>
39+
<td>(<i>string | number</i>) the id of a data field to sort by</td>
40+
</tr>
41+
<tr>
42+
<td><b>dir</b></td>
43+
<td>(<i>string</i>) the direction of sorting: "asc" or "desc"</td>
44+
</tr>
45+
<tr>
46+
<td><b>as</b></td>
47+
<td>(<i>function</i>) optional, a custom function of converting values before comparing</td>
48+
</tr>
49+
<tr>
50+
<td><b>rule</b></td>
51+
<td>(<i>function</i>) optional, a custom sorting function</td>
52+
</tr>
53+
<tr>
54+
<td><b>smartSorting</b></td>
55+
<td>(<i>boolean</i>) optional, (if applied) specifies whether a sorting rule should be applied each time after changing the data set</td>
56+
</tr>
57+
</tbody>
58+
</table>
59+
60+
@changelog:
61+
added in v9.1

docs/data_collection/api/datacollection_sort_method.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,22 @@ description: You can explore the sort method of DataCollection in the documentat
1212

1313
@params:
1414
- `rule: object` - an object with parameters for sorting. The object has the following attributes:
15-
- `by: string | number` - the id of a data field (a column of Grid)
15+
- `by: string | number` - the id of a data field
1616
- `dir: string` - the direction of sorting: "asc" or "desc"
1717
- `as: function` - a function that specifies the type to sort data as
1818
- `rule: function` - optional, a sorting rule; the function must have two parameters and return a number (-1,0,1)
1919
- `config: object` - defines the parameter of sorting. It may contain one property:
2020
- `smartSorting: boolean` - specifies whether a sorting rule should be applied each time after changing the data set
2121

2222
@example:
23-
grid.data.sort({
24-
by:"a",
25-
dir:"desc",
26-
as: function(item){
27-
return item.toUpperCase();
28-
},
23+
grid.data.sort(
2924
{
30-
smartSorting: true
31-
}
32-
});
25+
by:"a",
26+
dir:"desc",
27+
as: item => (item.toUpperCase())
28+
},
29+
{ smartSorting: true }
30+
);
3331

3432
// cancels the applied sorting rules
3533
grid.data.sort();

docs/data_collection/index.md

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,41 @@ description: You can have an overview of DataCollection in the documentation of
99
A set of APIs that allow you to work with data of a component. Applicable to Chart, Combobox, DataView, Grid, List.
1010
## Methods
1111

12-
| Name | Description |
13-
| ----------------------------------------------- | ------------------------------------------------------ |
14-
| [](api/datacollection_add_method.md) | @getshort(api/datacollection_add_method.md) |
15-
| [](api/datacollection_changeid_method.md) | @getshort(api/datacollection_changeid_method.md) |
16-
| [](api/datacollection_copy_method.md) | @getshort(api/datacollection_copy_method.md) |
17-
| [](api/datacollection_exists_method.md) | @getshort(api/datacollection_exists_method.md) |
18-
| [](api/datacollection_filter_method.md) | @getshort(api/datacollection_filter_method.md) |
19-
| [](api/datacollection_find_method.md) | @getshort(api/datacollection_find_method.md) |
20-
| [](api/datacollection_findall_method.md) | @getshort(api/datacollection_findall_method.md) |
21-
| [](api/datacollection_foreach_method.md) | @getshort(api/datacollection_foreach_method.md) |
22-
| [](api/datacollection_getfilters_method.md) | @getshort(api/datacollection_getfilters_method.md) |
23-
| [](api/datacollection_getid_method.md) | @getshort(api/datacollection_getid_method.md) |
24-
| [](api/datacollection_getindex_method.md) | @getshort(api/datacollection_getindex_method.md) |
25-
| [](api/datacollection_getinitialdata_method.md) | @getshort(api/datacollection_getinitialdata_method.md) |
26-
| [](api/datacollection_getitem_method.md) | @getshort(api/datacollection_getitem_method.md) |
27-
| [](api/datacollection_getlength_method.md) | @getshort(api/datacollection_getlength_method.md) |
28-
| [](api/datacollection_group_method.md) | @getshort(api/datacollection_group_method.md) |
29-
| [](api/datacollection_isdataloaded_method.md) | @getshort(api/datacollection_isdataloaded_method.md) |
30-
| [](api/datacollection_isgrouped_method.md) | @getshort(api/datacollection_isgrouped_method.md) |
31-
| [](api/datacollection_issaved_method.md) | @getshort(api/datacollection_issaved_method.md) |
32-
| [](api/datacollection_load_method.md) | @getshort(api/datacollection_load_method.md) |
33-
| [](api/datacollection_map_method.md) | @getshort(api/datacollection_map_method.md) |
34-
| [](api/datacollection_maprange_method.md) | @getshort(api/datacollection_maprange_method.md) |
35-
| [](api/datacollection_move_method.md) | @getshort(api/datacollection_move_method.md) |
36-
| [](api/datacollection_parse_method.md) | @getshort(api/datacollection_parse_method.md) |
37-
| [](api/datacollection_reduce_method.md) | @getshort(api/datacollection_reduce_method.md) |
38-
| [](api/datacollection_remove_method.md) | @getshort(api/datacollection_remove_method.md) |
39-
| [](api/datacollection_removeall_method.md) | @getshort(api/datacollection_removeall_method.md) |
40-
| [](api/datacollection_resetfilter_method.md) | @getshort(api/datacollection_resetfilter_method.md) |
41-
| [](api/datacollection_save_method.md) | @getshort(api/datacollection_save_method.md) |
42-
| [](api/datacollection_serialize_method.md) | @getshort(api/datacollection_serialize_method.md) |
43-
| [](api/datacollection_sort_method.md) | @getshort(api/datacollection_sort_method.md) |
44-
| [](api/datacollection_ungroup_method.md) | @getshort(api/datacollection_ungroup_method.md) |
45-
| [](api/datacollection_update_method.md) | @getshort(api/datacollection_update_method.md) |
12+
| Name | Description |
13+
| ------------------------------------------------- | ------------------------------------------------------- |
14+
| [](api/datacollection_add_method.md) | @getshort(api/datacollection_add_method.md) |
15+
| [](api/datacollection_changeid_method.md) | @getshort(api/datacollection_changeid_method.md) |
16+
| [](api/datacollection_copy_method.md) | @getshort(api/datacollection_copy_method.md) |
17+
| [](api/datacollection_exists_method.md) | @getshort(api/datacollection_exists_method.md) |
18+
| [](api/datacollection_filter_method.md) | @getshort(api/datacollection_filter_method.md) |
19+
| [](api/datacollection_find_method.md) | @getshort(api/datacollection_find_method.md) |
20+
| [](api/datacollection_findall_method.md) | @getshort(api/datacollection_findall_method.md) |
21+
| [](api/datacollection_foreach_method.md) | @getshort(api/datacollection_foreach_method.md) |
22+
| [](api/datacollection_getfilters_method.md) | @getshort(api/datacollection_getfilters_method.md) |
23+
| [](api/datacollection_getid_method.md) | @getshort(api/datacollection_getid_method.md) |
24+
| [](api/datacollection_getindex_method.md) | @getshort(api/datacollection_getindex_method.md) |
25+
| [](api/datacollection_getinitialdata_method.md) | @getshort(api/datacollection_getinitialdata_method.md) |
26+
| [](api/datacollection_getitem_method.md) | @getshort(api/datacollection_getitem_method.md) |
27+
| [](api/datacollection_getlength_method.md) | @getshort(api/datacollection_getlength_method.md) |
28+
| [](api/datacollection_getsortingstates_method.md) | @getshort(api/datacollection_getsortingstates_method.md)|
29+
| [](api/datacollection_group_method.md) | @getshort(api/datacollection_group_method.md) |
30+
| [](api/datacollection_isdataloaded_method.md) | @getshort(api/datacollection_isdataloaded_method.md) |
31+
| [](api/datacollection_isgrouped_method.md) | @getshort(api/datacollection_isgrouped_method.md) |
32+
| [](api/datacollection_issaved_method.md) | @getshort(api/datacollection_issaved_method.md) |
33+
| [](api/datacollection_load_method.md) | @getshort(api/datacollection_load_method.md) |
34+
| [](api/datacollection_map_method.md) | @getshort(api/datacollection_map_method.md) |
35+
| [](api/datacollection_maprange_method.md) | @getshort(api/datacollection_maprange_method.md) |
36+
| [](api/datacollection_move_method.md) | @getshort(api/datacollection_move_method.md) |
37+
| [](api/datacollection_parse_method.md) | @getshort(api/datacollection_parse_method.md) |
38+
| [](api/datacollection_reduce_method.md) | @getshort(api/datacollection_reduce_method.md) |
39+
| [](api/datacollection_remove_method.md) | @getshort(api/datacollection_remove_method.md) |
40+
| [](api/datacollection_removeall_method.md) | @getshort(api/datacollection_removeall_method.md) |
41+
| [](api/datacollection_resetfilter_method.md) | @getshort(api/datacollection_resetfilter_method.md) |
42+
| [](api/datacollection_save_method.md) | @getshort(api/datacollection_save_method.md) |
43+
| [](api/datacollection_serialize_method.md) | @getshort(api/datacollection_serialize_method.md) |
44+
| [](api/datacollection_sort_method.md) | @getshort(api/datacollection_sort_method.md) |
45+
| [](api/datacollection_ungroup_method.md) | @getshort(api/datacollection_ungroup_method.md) |
46+
| [](api/datacollection_update_method.md) | @getshort(api/datacollection_update_method.md) |
4647

4748
## Events
4849

0 commit comments

Comments
 (0)