Skip to content

Commit 1f15f8d

Browse files
Grids: update onAdd description (DevExpress#6895)
1 parent 2da7b21 commit 1f15f8d

File tree

1 file changed

+8
-1
lines changed
  • api-reference/10 UI Components/GridBase/1 Configuration/rowDragging

1 file changed

+8
-1
lines changed

api-reference/10 UI Components/GridBase/1 Configuration/rowDragging/onAdd.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,16 @@ The instance of the row's target UI component.
3939
Custom [data](/api-reference/10%20UI%20Components/GridBase/1%20Configuration/rowDragging/data.md '{basewidgetpath}/Configuration/rowDragging/#data') associated with the target UI component.
4040

4141
##### field(e.toIndex): Number
42-
The position in which the row is placed. If the row is dragged away from the UI component, the value is **-1**.
42+
The position in which the row is placed. If the row is dragged away from the UI component, the value is **-1**. If [virtual scrolling]({basewidgetpath}/Configuration/scrolling/#mode) is enabled, the **toIndex** parameter starts from the top visible row.
4343

4444
---
4545
#include btn-open-demo with {
4646
href: "https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/DnDBetweenGrids/"
4747
}
48+
49+
Use a row key to identify the target row. Call the [getKeyByRowIndex]({basewidgetpath}/Methods/#getKeyByRowIndexrowIndex) method to obtain the key:
50+
51+
const onAdd = (e) => {
52+
console.log(e.toComponent.getKeyByRowIndex(e.toIndex - 1));
53+
// ...
54+
}

0 commit comments

Comments
 (0)