Skip to content

Commit

Permalink
Revert "Regenerate without hidden CollectionWidget events (3) like 7e…
Browse files Browse the repository at this point in the history
…46694"

This reverts commit 8df9d6c.
  • Loading branch information
mpreyskurantov committed Nov 21, 2023
1 parent 8ce703a commit a15a63b
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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<void>
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 (<a href="http://api.jquery.com/Types/#Promise" target="_blank">jQuery</a> or <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" target="_blank">native</a>), which enables you to perform an asynchronous action before an item is deleted.

Expand Down
Original file line number Diff line number Diff line change
@@ -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.

---

0 comments on commit a15a63b

Please sign in to comment.