File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
hierarchical-grid/row-drag-base/src
tree-grid/row-drag-base/src Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ export default function App() {
22
22
const ghostElement = evt . detail . dragDirective . ghostElement ;
23
23
if ( ghostElement != null ) {
24
24
const dragElementPos = ghostElement . getBoundingClientRect ( ) ;
25
- const gridPosition = document . getElementById ( "rightGrid" ) . getBoundingClientRect ( ) ;
25
+ const gridPosition = document . getElementById ( "rightGrid" ) . getElementsByTagName ( "igc-grid" ) [ 0 ] . getBoundingClientRect ( ) ;
26
26
27
27
const withinXBounds = dragElementPos . x >= gridPosition . x && dragElementPos . x <= gridPosition . x + gridPosition . width ;
28
28
const withinYBounds = dragElementPos . y >= gridPosition . y && dragElementPos . y <= gridPosition . y + gridPosition . height ;
29
29
if ( withinXBounds && withinYBounds ) {
30
- grid . deleteRow ( evt . detail . dragData . index ) ;
30
+ grid . deleteRow ( evt . detail . dragData . key ) ;
31
31
rightGridRef . current . addRow ( evt . detail . dragData . data ) ;
32
32
}
33
33
}
@@ -36,7 +36,7 @@ export default function App() {
36
36
return (
37
37
< div className = "container sample" >
38
38
< div className = "container horizontal wrapper" >
39
- < IgrGrid data = { data } width = "40%" autoGenerate = "false" rowDraggable = "true" rowDragEnd = { onGridRowDragEnd } >
39
+ < IgrGrid data = { data } width = "40%" primaryKey = 'ID' autoGenerate = "false" rowDraggable = "true" rowDragEnd = { onGridRowDragEnd } >
40
40
< IgrColumn field = "ID" width = "100px" > </ IgrColumn >
41
41
< IgrColumn field = "CompanyName" width = "100px" > </ IgrColumn >
42
42
< IgrColumn field = "ContactName" width = "100px" > </ IgrColumn >
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export default function App() {
27
27
const ghostElement = evt . detail . dragDirective . ghostElement ;
28
28
if ( ghostElement != null ) {
29
29
const dragElementPos = ghostElement . getBoundingClientRect ( ) ;
30
- const gridPosition = document . getElementById ( "hierarchicalGrid2" ) . getBoundingClientRect ( ) ;
30
+ const gridPosition = document . getElementById ( "hierarchicalGrid2" ) . getElementsByTagName ( "igc-hierarchical-grid" ) [ 0 ] . getBoundingClientRect ( ) ;
31
31
32
32
const withinXBounds = dragElementPos . x >= gridPosition . x && dragElementPos . x <= gridPosition . x + gridPosition . width ;
33
33
const withinYBounds = dragElementPos . y >= gridPosition . y && dragElementPos . y <= gridPosition . y + gridPosition . height ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export default function App() {
36
36
const ghostElement = evt . detail . dragDirective . ghostElement ;
37
37
if ( ghostElement != null ) {
38
38
const dragElementPos = ghostElement . getBoundingClientRect ( ) ;
39
- const gridPosition = document . getElementById ( "treeGrid2" ) . getBoundingClientRect ( ) ;
39
+ const gridPosition = document . getElementById ( "treeGrid2" ) . getElementsByTagName ( "igc-tree-grid" ) [ 0 ] . getBoundingClientRect ( ) ;
40
40
41
41
const withinXBounds = dragElementPos . x >= gridPosition . x && dragElementPos . x <= gridPosition . x + gridPosition . width ;
42
42
const withinYBounds = dragElementPos . y >= gridPosition . y && dragElementPos . y <= gridPosition . y + gridPosition . height ;
You can’t perform that action at this time.
0 commit comments