diff --git a/docs/data_collection/api/datacollection_add_method.md b/docs/data_collection/api/datacollection_add_method.md index 2ee3a3cd..453e27b8 100644 --- a/docs/data_collection/api/datacollection_add_method.md +++ b/docs/data_collection/api/datacollection_add_method.md @@ -8,6 +8,10 @@ description: You can explore the add method of DataCollection in the documentati @short: adds a new item to the component +:::note +Please note that data should be loaded into DataCollection via the `parse()` method. The `add()` method is primarily intended for loading standalone elements or small groups of elements, so its loads data slower than the `parse()` method. +::: + @signature: {'add(new_item: object | object[], index?: number): (string | number) | (string | number)[];'} @params: diff --git a/docs/data_collection/api/datacollection_afteradd_event.md b/docs/data_collection/api/datacollection_afteradd_event.md index 829febbb..dde9b08b 100644 --- a/docs/data_collection/api/datacollection_afteradd_event.md +++ b/docs/data_collection/api/datacollection_afteradd_event.md @@ -6,16 +6,18 @@ description: You can explore the afterAdd event of DataCollection in the documen # afterAdd -@short: fires after adding a new item into a data collection +@short: fires after adding a new item/items into a data collection -@signature: {'afterAdd: (newItem: object) => void;'} +@signature: {'afterAdd: (newItem: IDataItem, batch: IDataItem[], index: number) => void;'} @params: - `newItem: object` - the object of an added item +- `batch: array` - an array of added items +- `index: number` - the index of the added item within the batch @example: -component.data.events.on("afterAdd", function(newItem){ - console.log("A new item is added"); +component.data.events.on("afterAdd", function(newItem, batch, index){ + console.log("New items are added"); }); @descr: diff --git a/docs/data_collection/api/datacollection_afterremove_event.md b/docs/data_collection/api/datacollection_afterremove_event.md index 8575e8ea..d8e44a84 100644 --- a/docs/data_collection/api/datacollection_afterremove_event.md +++ b/docs/data_collection/api/datacollection_afterremove_event.md @@ -6,16 +6,18 @@ description: You can explore the afterRemove event of DataCollection in the docu # afterRemove -@short: Fires after removing an item from a data collection +@short: Fires after removing an item/items from a data collection -@signature: {'afterRemove: (removedItem: object) => void;'} +@signature: {'afterRemove: (removedItem: IDataItem, batch: IDataItem[], index: number) => void;'} @params: - `removedItem: object` - the object of a removed item +- `batch: array` - an array of removed items +- `index: number` - the index of the removed item within the batch @example: -component.data.events.on("afterRemove", function(removedItem){ - console.log("An item is removed"); +component.data.events.on("afterRemove", function(removedItem, batch, index){ + console.log("Items are removed"); }); @descr: diff --git a/docs/data_collection/api/datacollection_beforeadd_event.md b/docs/data_collection/api/datacollection_beforeadd_event.md index 93c9ae12..8554d3ca 100644 --- a/docs/data_collection/api/datacollection_beforeadd_event.md +++ b/docs/data_collection/api/datacollection_beforeadd_event.md @@ -6,19 +6,21 @@ description: You can explore the beforeAdd event of DataCollection in the docume # beforeAdd -@short: fires before adding a new item into a data collection +@short: fires before adding a new item/items into a data collection -@signature: {'beforeAdd: (newItem: object) => boolean | void;'} +@signature: {'beforeAdd: (newItem: IDataItem, batch: IDataItem[], index: number) => boolean | void;'} @params: - `newItem: object` - the object of an added item +- `batch: array` - an array of added items +- `index: number` - the index of the added item within the batch @returns: Return `false` to prevent an item adding into a data collection; otherwise, `true`. @example: -component.data.events.on("beforeAdd", function(newItem){ - console.log("A new item will be added"); +component.data.events.on("beforeAdd", function(newItem, batch, index){ + console.log("New items will be added"); return true; }); diff --git a/docs/data_collection/api/datacollection_beforeremove_event.md b/docs/data_collection/api/datacollection_beforeremove_event.md index e036aaf5..3db8ef81 100644 --- a/docs/data_collection/api/datacollection_beforeremove_event.md +++ b/docs/data_collection/api/datacollection_beforeremove_event.md @@ -6,19 +6,21 @@ description: You can explore the beforeRemove event of DataCollection in the doc # beforeRemove -@short: fires before removing an item from a data collection +@short: fires before removing an item/items from a data collection -@signature: {'beforeRemove: (removedItem: object) => boolean | void;'} +@signature: {'beforeRemove: (removedItem: IDataItem, batch: IDataItem[], index: number) => boolean | void;'} @params: - `removedItem: object` - the object of an item to remove +- `batch: array` - an array of removed items +- `index: number` - the index of the removed item within the batch @returns: Return `false` to block removing an item from a data collection; otherwise, `true`. @example: -component.data.events.on("beforeRemove", function(removedItem){ - console.log("An item will be removed"); +component.data.events.on("beforeRemove", function(removedItem, batch, index){ + console.log("Items will be removed"); return true; }); diff --git a/docs/whatsnew.md b/docs/whatsnew.md index 5e9f6901..c860dca2 100644 --- a/docs/whatsnew.md +++ b/docs/whatsnew.md @@ -8,6 +8,20 @@ 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.2.5 + +Released on November 28, 2025 + +### Updates + +- DataCollection. The [`beforeAdd`](/data_collection/api/datacollection_beforeadd_event/), [`afterAdd`](/data_collection/api/datacollection_afteradd_event/), [`beforeRemove`](/data_collection/api/datacollection_beforeremove_event/), and [`afterRemove`](/data_collection/api/datacollection_afterremove_event/) events are updated to include the `batch` and `index` parameters for handling batch operations + +### Fixes + +- Grid. Improved performance of adding and removing data via the `add()` and `remove()` methods when the `adjust` configuration is enabled +- Grid. The issue where the combo filter with enabled `multiselection` displayed all options ignoring other active filters is fixed +- TreeCollection. The issue where the `items` property of a parent object returned by the `getItem()` and `find()` methods included a removed child item is fixed + ## Version 9.2.4 Released on November 17, 2025