Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
77cf143
[update] move treegrid api to grid and update descriptions
mafanya23 Feb 3, 2025
17f2f50
[add] grid subRow/subRowConfig properties descriptions
mafanya23 Feb 3, 2025
28a04cb
[update] treegrid mode guide, fix api descriptions
mafanya23 Feb 4, 2025
42c1209
[add] a draft for the row expander guide, updates and fixes in api
mafanya23 Feb 6, 2025
615dedd
[update] complete the row expander guide and api
mafanya23 Feb 7, 2025
00e79bb
[update] examples for expand/collapse grid api
mafanya23 Feb 10, 2025
9271fd0
[update] minor corrections in row expander guide
mafanya23 Feb 10, 2025
46b5453
[add] a draft for what's new of v9.1
mafanya23 Feb 10, 2025
98401ae
[add] getSortingStates() method page for data/treecollection
mafanya23 Feb 10, 2025
93ee18f
Merge branch 'next' into grid-row-expander-3443
mafanya23 Feb 10, 2025
4b13f36
[update] data sorting api and guide
mafanya23 Feb 10, 2025
17017fa
[update] move treegrid configs to grid api
mafanya23 Feb 11, 2025
667f938
[add] how to work with row expander section into grid features
mafanya23 Feb 11, 2025
0012371
[update] improve grid row expander guide and api
mafanya23 Feb 11, 2025
7e212f9
[update] grid multi-sorting guide and api
mafanya23 Feb 12, 2025
69f9afd
Merge branch 'next' into 9.1
mafanya23 Feb 12, 2025
f4c268d
[update] what's new for v9.1
mafanya23 Feb 12, 2025
16ea244
[add] a section on multi-user backend
mafanya23 Feb 13, 2025
20c18e1
[add] images for row expander guide
mafanya23 Feb 13, 2025
34cd9ea
[update] docs for v9.1
mafanya23 Feb 13, 2025
944ef1a
[fix] minor corrections in the sort(), filter() methods of treecollec…
mafanya23 Feb 14, 2025
cd19b46
[fix] corrections in data/treecollection sort() examples
mafanya23 Feb 14, 2025
2d96541
[update] what's new for v9.1
mafanya23 Feb 17, 2025
b693868
[fix] a broken link
mafanya23 Feb 17, 2025
3c22aae
[update] what's new for v9.1
mafanya23 Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/grid/multi_level_nesting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/grid/multisort_grouped_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/grid/multisorting_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/grid/row_expander.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/grid/subgrid_specific_rows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/data_collection/api/datacollection_filter_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ description: You can explore the filter method of DataCollection in the document
- `rule: function | object` - the filtering criteria
- 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*
- If set as an *object*, the parameter has the following attributes:
- `by: string | number` - mandatory, the id of a data field (the column of Grid)
- `by: string | number` - mandatory, the id of a data field
- `match: string` - mandatory, a pattern to match
- `compare: function` - optional, a function for extended filtering that takes three parameters:
- `value` - the value to compare (e.g. a column in a row for Grid)
- `value` - the value to compare
- `match` - a pattern to match
- `item` - a data item the values of which should be compared (e.g. a row)
- `item` - a data item the values of which should be compared
- `config: object` - optional, defines the parameters of filtering. It may contain the following properties:
- `id: string` - optional, the id of the filter
- `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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description: You can explore the getFilters method of DataCollection in the docu
- `permanent: boolean` - optional, <i>false</i> by default. Allows getting the list of permanent filters

@returns:
- `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)
- `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)

@example:
const filters = grid.data.getFilters();
Expand Down
61 changes: 61 additions & 0 deletions docs/data_collection/api/datacollection_getsortingstates_method.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
sidebar_label: getSortingStates()
title: JavaScript DataCollection - getSortingStates Method
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.
---

# getSortingStates()

@short: returns an array of objects with the current parameters of sorting applied to the data

## Usage

~~~jsx
interface ISortingState {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mafanya23 тот же комментарий, что и к TreeGridCollection

by: string | number,
dir: "asc" | "desc",
as?: (a) => any,
rule?: (a, b) => number,
smartSorting?: boolean
}

getSortingStates(): ISortingState[];
~~~

@returns:
An array of objects with the current parameters of sorting applied to the data.

@example:
const state = grid.data.getSortingStates();
// -> [{by: "country", dir: "desc"}, {by: "population", dir: "desc"}]

@descr:
The array returned by the method contains objects with the following properties:

<table>
<tbody>
<tr>
<td><b>by</b></td>
<td>(<i>string | number</i>) the id of a data field to sort by</td>
</tr>
<tr>
<td><b>dir</b></td>
<td>(<i>string</i>) the direction of sorting: "asc" or "desc"</td>
</tr>
<tr>
<td><b>as</b></td>
<td>(<i>function</i>) optional, a custom function of converting values before comparing</td>
</tr>
<tr>
<td><b>rule</b></td>
<td>(<i>function</i>) optional, a custom sorting function</td>
</tr>
<tr>
<td><b>smartSorting</b></td>
<td>(<i>boolean</i>) optional, (if applied) specifies whether a sorting rule should be applied each time after changing the data set</td>
</tr>
</tbody>
</table>

@changelog:
added in v9.1
18 changes: 8 additions & 10 deletions docs/data_collection/api/datacollection_sort_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,22 @@ description: You can explore the sort method of DataCollection in the documentat

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

@example:
grid.data.sort({
by:"a",
dir:"desc",
as: function(item){
return item.toUpperCase();
},
grid.data.sort(
{
smartSorting: true
}
});
by:"a",
dir:"desc",
as: item => (item.toUpperCase())
},
{ smartSorting: true }
);

// cancels the applied sorting rules
grid.data.sort();
Expand Down
69 changes: 35 additions & 34 deletions docs/data_collection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,41 @@ description: You can have an overview of DataCollection in the documentation of
A set of APIs that allow you to work with data of a component. Applicable to Chart, Combobox, DataView, Grid, List.
## Methods

| Name | Description |
| ----------------------------------------------- | ------------------------------------------------------ |
| [](api/datacollection_add_method.md) | @getshort(api/datacollection_add_method.md) |
| [](api/datacollection_changeid_method.md) | @getshort(api/datacollection_changeid_method.md) |
| [](api/datacollection_copy_method.md) | @getshort(api/datacollection_copy_method.md) |
| [](api/datacollection_exists_method.md) | @getshort(api/datacollection_exists_method.md) |
| [](api/datacollection_filter_method.md) | @getshort(api/datacollection_filter_method.md) |
| [](api/datacollection_find_method.md) | @getshort(api/datacollection_find_method.md) |
| [](api/datacollection_findall_method.md) | @getshort(api/datacollection_findall_method.md) |
| [](api/datacollection_foreach_method.md) | @getshort(api/datacollection_foreach_method.md) |
| [](api/datacollection_getfilters_method.md) | @getshort(api/datacollection_getfilters_method.md) |
| [](api/datacollection_getid_method.md) | @getshort(api/datacollection_getid_method.md) |
| [](api/datacollection_getindex_method.md) | @getshort(api/datacollection_getindex_method.md) |
| [](api/datacollection_getinitialdata_method.md) | @getshort(api/datacollection_getinitialdata_method.md) |
| [](api/datacollection_getitem_method.md) | @getshort(api/datacollection_getitem_method.md) |
| [](api/datacollection_getlength_method.md) | @getshort(api/datacollection_getlength_method.md) |
| [](api/datacollection_group_method.md) | @getshort(api/datacollection_group_method.md) |
| [](api/datacollection_isdataloaded_method.md) | @getshort(api/datacollection_isdataloaded_method.md) |
| [](api/datacollection_isgrouped_method.md) | @getshort(api/datacollection_isgrouped_method.md) |
| [](api/datacollection_issaved_method.md) | @getshort(api/datacollection_issaved_method.md) |
| [](api/datacollection_load_method.md) | @getshort(api/datacollection_load_method.md) |
| [](api/datacollection_map_method.md) | @getshort(api/datacollection_map_method.md) |
| [](api/datacollection_maprange_method.md) | @getshort(api/datacollection_maprange_method.md) |
| [](api/datacollection_move_method.md) | @getshort(api/datacollection_move_method.md) |
| [](api/datacollection_parse_method.md) | @getshort(api/datacollection_parse_method.md) |
| [](api/datacollection_reduce_method.md) | @getshort(api/datacollection_reduce_method.md) |
| [](api/datacollection_remove_method.md) | @getshort(api/datacollection_remove_method.md) |
| [](api/datacollection_removeall_method.md) | @getshort(api/datacollection_removeall_method.md) |
| [](api/datacollection_resetfilter_method.md) | @getshort(api/datacollection_resetfilter_method.md) |
| [](api/datacollection_save_method.md) | @getshort(api/datacollection_save_method.md) |
| [](api/datacollection_serialize_method.md) | @getshort(api/datacollection_serialize_method.md) |
| [](api/datacollection_sort_method.md) | @getshort(api/datacollection_sort_method.md) |
| [](api/datacollection_ungroup_method.md) | @getshort(api/datacollection_ungroup_method.md) |
| [](api/datacollection_update_method.md) | @getshort(api/datacollection_update_method.md) |
| Name | Description |
| ------------------------------------------------- | ------------------------------------------------------- |
| [](api/datacollection_add_method.md) | @getshort(api/datacollection_add_method.md) |
| [](api/datacollection_changeid_method.md) | @getshort(api/datacollection_changeid_method.md) |
| [](api/datacollection_copy_method.md) | @getshort(api/datacollection_copy_method.md) |
| [](api/datacollection_exists_method.md) | @getshort(api/datacollection_exists_method.md) |
| [](api/datacollection_filter_method.md) | @getshort(api/datacollection_filter_method.md) |
| [](api/datacollection_find_method.md) | @getshort(api/datacollection_find_method.md) |
| [](api/datacollection_findall_method.md) | @getshort(api/datacollection_findall_method.md) |
| [](api/datacollection_foreach_method.md) | @getshort(api/datacollection_foreach_method.md) |
| [](api/datacollection_getfilters_method.md) | @getshort(api/datacollection_getfilters_method.md) |
| [](api/datacollection_getid_method.md) | @getshort(api/datacollection_getid_method.md) |
| [](api/datacollection_getindex_method.md) | @getshort(api/datacollection_getindex_method.md) |
| [](api/datacollection_getinitialdata_method.md) | @getshort(api/datacollection_getinitialdata_method.md) |
| [](api/datacollection_getitem_method.md) | @getshort(api/datacollection_getitem_method.md) |
| [](api/datacollection_getlength_method.md) | @getshort(api/datacollection_getlength_method.md) |
| [](api/datacollection_getsortingstates_method.md) | @getshort(api/datacollection_getsortingstates_method.md)|
| [](api/datacollection_group_method.md) | @getshort(api/datacollection_group_method.md) |
| [](api/datacollection_isdataloaded_method.md) | @getshort(api/datacollection_isdataloaded_method.md) |
| [](api/datacollection_isgrouped_method.md) | @getshort(api/datacollection_isgrouped_method.md) |
| [](api/datacollection_issaved_method.md) | @getshort(api/datacollection_issaved_method.md) |
| [](api/datacollection_load_method.md) | @getshort(api/datacollection_load_method.md) |
| [](api/datacollection_map_method.md) | @getshort(api/datacollection_map_method.md) |
| [](api/datacollection_maprange_method.md) | @getshort(api/datacollection_maprange_method.md) |
| [](api/datacollection_move_method.md) | @getshort(api/datacollection_move_method.md) |
| [](api/datacollection_parse_method.md) | @getshort(api/datacollection_parse_method.md) |
| [](api/datacollection_reduce_method.md) | @getshort(api/datacollection_reduce_method.md) |
| [](api/datacollection_remove_method.md) | @getshort(api/datacollection_remove_method.md) |
| [](api/datacollection_removeall_method.md) | @getshort(api/datacollection_removeall_method.md) |
| [](api/datacollection_resetfilter_method.md) | @getshort(api/datacollection_resetfilter_method.md) |
| [](api/datacollection_save_method.md) | @getshort(api/datacollection_save_method.md) |
| [](api/datacollection_serialize_method.md) | @getshort(api/datacollection_serialize_method.md) |
| [](api/datacollection_sort_method.md) | @getshort(api/datacollection_sort_method.md) |
| [](api/datacollection_ungroup_method.md) | @getshort(api/datacollection_ungroup_method.md) |
| [](api/datacollection_update_method.md) | @getshort(api/datacollection_update_method.md) |

## Events

Expand Down
Loading
Loading