From a15a63b9849b27a90d98888d3a8046d81e6d0465 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov Date: Tue, 21 Nov 2023 13:05:42 +0200 Subject: [PATCH] Revert "Regenerate without hidden CollectionWidget events (3) like 7e4669448f2b43681e44d659360031b24c5ec328" This reverts commit 8df9d6c9e2d66a553f85967592116e27485c3df1. --- .../1 Configuration/onItemDeleted.md | 23 +++++++++++++++ .../1 Configuration/onItemDeleting.md | 26 +++++++++++++++++ .../1 Configuration/onItemReordered.md | 29 +++++++++++++++++++ 3 files changed, 78 insertions(+) diff --git a/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemDeleted.md b/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemDeleted.md index de6a8146bd..584bf64c9f 100644 --- a/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemDeleted.md +++ b/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemDeleted.md @@ -1,10 +1,33 @@ --- id: CollectionWidget.Options.onItemDeleted +type: function(e) +default: null hidden: --- --- ##### shortDescription A function that is executed after a collection item is deleted from the data source. +##### param(e): Object +Information about the event. + +##### field(e.component): {WidgetName} +The UI component's instance. + +##### field(e.element): DxElement +#include common-ref-elementparam with { element: "UI component" } + +##### field(e.itemData): Object +The removed item's data. + +##### field(e.itemElement): DxElement +#include common-ref-elementparam with { element: "item" } + +##### field(e.itemIndex): Number | Object +The removed item's index. + +##### field(e.model): Object +Model data. Available only if you use Knockout. + --- Note that the **itemDeleted** event is raised only if an item is deleted using the appropriate method of the UI component or end-user interaction. If you delete an item from an observable array passed to the **dataSource** or **items** property, the UI component entirely reloads the items array without raising the **itemDeleted** and **itemDeleting** events. \ No newline at end of file diff --git a/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemDeleting.md b/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemDeleting.md index 7920b026fa..f07df0bfd4 100644 --- a/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemDeleting.md +++ b/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemDeleting.md @@ -1,11 +1,37 @@ --- id: CollectionWidget.Options.onItemDeleting +type: function(e) +default: null hidden: --- --- ##### shortDescription A function that is executed before a collection item is deleted from the data source. +##### param(e): Object +Information about the event. + +##### field(e.cancel): Boolean | Promise +Allows you to cancel the item deletion. + +##### field(e.component): {WidgetName} +The UI component's instance. + +##### field(e.element): DxElement +#include common-ref-elementparam with { element: "UI component" } + +##### field(e.itemData): Object +The data of the item to be removed. + +##### field(e.itemElement): DxElement +#include common-ref-elementparam with { element: "item" } + +##### field(e.itemIndex): Number | Object +The item's index. + +##### field(e.model): Object +Model data. Available only if you use Knockout. + --- You can cancel item deletion by setting the handler parameter's **cancel** field to **true**. This field also accepts a Promise (jQuery or native), which enables you to perform an asynchronous action before an item is deleted. diff --git a/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemReordered.md b/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemReordered.md index aefc5869f7..ae584b563e 100644 --- a/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemReordered.md +++ b/api-reference/10 UI Components/CollectionWidget/1 Configuration/onItemReordered.md @@ -1,9 +1,38 @@ --- id: CollectionWidget.Options.onItemReordered +type: function(e) +default: null hidden: --- --- ##### shortDescription A function that is executed after a collection item is moved to another position. +##### param(e): Object +Information about the event. + +##### field(e.component): {WidgetName} +The UI component's instance. + +##### field(e.element): DxElement +#include common-ref-elementparam with { element: "UI component" } + +##### field(e.fromIndex): Number +The item's previous index. + +##### field(e.itemData): Object +The reordered item's data. + +##### field(e.itemElement): DxElement +#include common-ref-elementparam with { element: "item" } + +##### field(e.itemIndex): Number | Object +The index of the item after reordering. This field holds the same value as **toIndex**. + +##### field(e.model): Object +Model data. Available only if you use Knockout. + +##### field(e.toIndex): Number +The item's current index. + ---