diff --git a/docs/data_collection/api/datacollection_filter_method.md b/docs/data_collection/api/datacollection_filter_method.md index 5a27f8a7..456a8a9b 100644 --- a/docs/data_collection/api/datacollection_filter_method.md +++ b/docs/data_collection/api/datacollection_filter_method.md @@ -21,10 +21,12 @@ description: You can explore the filter method of DataCollection in the document - `value` - the value to compare - `match` - a pattern to match - `item` - a data item the values of which should be compared + - `multi` - the value of the `multi` attribute of the rule + - `multi?: boolean` - optional, marks the field as holding several values at once (e.g. a multiselect column stores them as a comma-separated string). Passed to `compare` as its last argument - `config?: object` - optional, an object with 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 (true), or to the initial data (false, default) - - `permanent?: boolean` - optional, *true* to make the current filter permanent. It will be applied even if the next filtering doesn't have the `add:true` property in its configuration object. Such a filter can be removed just with the [resetFilter()](data_collection/api/datacollection_resetfilter_method.md) method + - `permanent?: boolean` - optional, *true* to make the current filter permanent. It is applied even if the next filtering doesn't have the `add:true` property in its configuration object. It is not dropped by a plain `resetFilter()` call and is reapplied to the data after `parse()` or `load()`; pass `permanent:true` to [resetFilter()](data_collection/api/datacollection_resetfilter_method.md) to remove it as well - `silent?: boolean` - optional, if set to true, the method will be called without triggering events, false by default :::info @@ -63,6 +65,8 @@ grid.data.filter({ @descr: +Unless `config.add` is set, the method replaces the currently applied filters; calling it without a rule at all drops all non-permanent filters and restores the unfiltered order. Permanent filters are the exception: they always survive and are reapplied first. The new rule then narrows their result further, so an item remains in the result only if it matches both the permanent filter and the new rule. + **Related sample**: [Data. Filter](https://snippet.dhtmlx.com/csiwq3kj) diff --git a/docs/data_collection/api/datacollection_load_method.md b/docs/data_collection/api/datacollection_load_method.md index bf50afce..77ccec4b 100644 --- a/docs/data_collection/api/datacollection_load_method.md +++ b/docs/data_collection/api/datacollection_load_method.md @@ -50,3 +50,5 @@ component.data.loadData.then(function () { // data loading has completed ~~~ +The method resets the applied sorting and filtering: the sorting is dropped, and so are all the filters except those applied with `permanent: true`, which are reapplied to the new data. + diff --git a/docs/data_collection/api/datacollection_parse_method.md b/docs/data_collection/api/datacollection_parse_method.md index e3a7f8ff..011618ee 100644 --- a/docs/data_collection/api/datacollection_parse_method.md +++ b/docs/data_collection/api/datacollection_parse_method.md @@ -44,4 +44,6 @@ dataview.data.parse(dataset); Please note that if you specify the `id` fields in the data collection, their values should be **unique**. You can also omit the `id` fields in the data collection. In this case they will be generated automatically. ::: +The method resets the applied sorting and filtering: the sorting is dropped, and so are all the filters except those applied with `permanent: true`, which are reapplied to the new data. + **Related sample**: [Data. Parse](https://snippet.dhtmlx.com/0zrxtmvi) diff --git a/docs/grid/data_loading.md b/docs/grid/data_loading.md index 7e7c18bd..3900b631 100644 --- a/docs/grid/data_loading.md +++ b/docs/grid/data_loading.md @@ -86,6 +86,10 @@ There are two ways to load data into Grid after its initialization: - [from an external file](#external-data-loading) - [from a local data source](#loading-from-local-source) +:::note +Calling `load()` or `parse()` resets the sorting and filtering applied to Grid: the sorting marks are cleared, and so are the values of the header filters. Filters applied with `permanent: true` are the exception: they are reapplied to the newly loaded data. +::: + ### External data loading To load data from an external file, make use of the **load()** method of [Data Collection](/data_collection/). It takes the URL of the file with data as a parameter: diff --git a/docs/grid/usage.md b/docs/grid/usage.md index a4596ec6..67984238 100644 --- a/docs/grid/usage.md +++ b/docs/grid/usage.md @@ -273,11 +273,11 @@ You can filter grid data by the specified criteria with the help of the `filter( rule - (object|function) the filtering criteria. It can be: + (object|function) the filtering criteria. It can be: config - (object) optional, an object with the following properties: + (object) optional, an object with the following properties: @@ -308,6 +308,8 @@ grid.data.filter({ }); ~~~ +Unless `config.add` is set, the method replaces the currently applied filters; calling it without a rule at all drops all non-permanent filters and restores the unfiltered order. Permanent filters are the exception: they always survive and are reapplied first. The new rule then narrows their result further, so an item remains in the result only if it matches both the permanent filter and the new rule. + **Related sample**: [Grid. Basic filter](https://snippet.dhtmlx.com/g0zpjqi1) ### Sorting data @@ -322,7 +324,7 @@ It is possible to sort data in the grid via the `sort()` method of [DataCollecti config - (object) defines the parameter of sorting. It takes one attribute: + (object) defines the parameter of sorting. It takes one attribute: diff --git a/docs/tree_collection/api/treecollection_filter_method.md b/docs/tree_collection/api/treecollection_filter_method.md index 461c84b3..0ca43408 100644 --- a/docs/tree_collection/api/treecollection_filter_method.md +++ b/docs/tree_collection/api/treecollection_filter_method.md @@ -16,16 +16,18 @@ description: You can explore the filter method of TreeCollection in the document - If set as an *object*, the parameter has the following attributes: - `by?: string | number` - optional, the id of a data field - `match?: string` - optional, a pattern to match - - `compare?: function` - optional, a function for extended filtering that takes three parameters: + - `compare?: function` - optional, a function for extended filtering that takes the following parameters: - `value` - the value to compare - `match` - a pattern to match - `item` - a data item the values of which should be compared + - `multi` - the value of the `multi` attribute of the rule + - `multi?: boolean` - optional, marks the field as holding several values at once (e.g. a multiselect column stores them as a comma-separated string). Passed to `compare` as its last argument - `config?: object` - optional, defines the parameters of filtering. The parameter may contain the following properties: - `type?: string` - optional, defines the area the filtering will be applied: "all", "level", "leafs" - `level?: number` - optional, the level the filtering will be applied to - `add?: boolean` - optional, defines whether each next filtering will be applied to the already filtered data (true), or to the initial data (false, default) - `id?: string` - optional, the id of the filter - - `permanent?: boolean` - optional, *true* to make the current filter permanent. It will be applied even if the next filtering doesn't have the `add:true` property in its configuration object. Such a filter can be removed just with the [resetFilter()](tree_collection/api/treecollection_resetfilter_method.md) method + - `permanent?: boolean` - optional, *true* to make the current filter permanent. It is applied even if the next filtering doesn't have the `add:true` property in its configuration object. It is not dropped by a plain `resetFilter()` call and is reapplied to the data after `parse()` or `load()`; pass `permanent:true` to [resetFilter()](tree_collection/api/treecollection_resetfilter_method.md) to remove it as well - `silent?: boolean` - optional, if set to true, the method will be called without triggering events, false by default :::info @@ -70,4 +72,6 @@ grid.data.filter({ @descr: +Unless `config.add` is set, the method replaces the currently applied filters; calling it without a rule at all drops all non-permanent filters and restores the unfiltered order. Permanent filters are the exception: they always survive and are reapplied first. The new rule then narrows their result further, so an item remains in the result only if it matches both the permanent filter and the new rule. + **Related sample**: [Grid (TreeGrid). Filter](https://snippet.dhtmlx.com/epsslwcd) diff --git a/docs/tree_collection/api/treecollection_load_method.md b/docs/tree_collection/api/treecollection_load_method.md index 91151b07..ec7ad51c 100644 --- a/docs/tree_collection/api/treecollection_load_method.md +++ b/docs/tree_collection/api/treecollection_load_method.md @@ -46,3 +46,5 @@ toolbar.data.loadData.then(function () { // loadData executes a callback function after an asynchronous // data loading has completed ~~~ + +The method resets the applied sorting and filtering: the sorting is dropped, and so are all the filters except those applied with `permanent: true`, which are reapplied to the new data. diff --git a/docs/tree_collection/api/treecollection_parse_method.md b/docs/tree_collection/api/treecollection_parse_method.md index 4710d8f2..c8b08132 100644 --- a/docs/tree_collection/api/treecollection_parse_method.md +++ b/docs/tree_collection/api/treecollection_parse_method.md @@ -58,4 +58,6 @@ toolbar.data.parse("" :::info Please note that if you specify the `id` fields in the tree collection, their values should be **unique**. You can also omit the `id` fields in the tree collection. In this case they will be generated automatically. -::: \ No newline at end of file +::: + +The method resets the applied sorting and filtering: the sorting is dropped, and so are all the filters except those applied with `permanent: true`, which are reapplied to the new data. \ No newline at end of file diff --git a/docs/whatsnew.md b/docs/whatsnew.md index e454640e..b8f64943 100644 --- a/docs/whatsnew.md +++ b/docs/whatsnew.md @@ -8,6 +8,28 @@ description: You can explore what's new in DHTMLX Suite and its release history Before updating DHTMLX to the latest version, please check the [Migration to Newer Versions](migration.md) guide to avoid possible breakdowns. +## Version 9.3.9 + +Released on August 13, 2026 + +### Updates + +- DataCollection/TreeCollection. The `parse()` and `load()` methods now reset existing sorting and filtering. Only filters with `permanent: true` are retained and reapplied to the new dataset +- Grid. Visual sorting indicators and header filter values are now automatically reset when data is reloaded via `parse()` or `load()` + +### Fixes + +- DataCollection. Fixed inconsistent results in `forEach()` and `map()` when `update()` was called from within the callback while sorting was active +- Grid. Fixed the duplication of selection overlays on spanned cells when using `selection: "complex"` +- Grid. Fixed a checkbox click in a sortable column header triggering a sort action +- Grid. Fixed a bug where an `undefined` CSS class was added to cells when using the `mark` property +- Grid. Fixed removing a grouped column via its "close" icon starting a column drag action +- Grid. Resolved an issue where `removeAll()` cleared header filter inputs but failed to reset the underlying filtering rules +- Grid. Fixed multiselect filtering for columns with `editorType: "multiselect"`; cells are now correctly matched if any of their values satisfy the filter +- TreeCollection. Fixed an issue where the tree could appear empty after `parse()` if a permanent filter was active +- TreeCollection. Fixed a bug where items were added twice when inserted into a sorted tree +- TreeCollection. Fixed the `multi` property of a filtering rule not being passed to the `compare` callback + ## Version 9.3.8 Released on August 3, 2026