Skip to content

Commit 5290728

Browse files
authored
Merge pull request #7536 from IgniteUI/mkirova/fix-5459-9.1.x
feat(igxGrid): Add a dragRowID property to the grid which holds the i…
2 parents 06afccc + a86e853 commit 5290728

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,13 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
599599
*/
600600
public rowDragging = false;
601601

602+
/**
603+
* Gets the row ID that is being dragged.
604+
* @remarks
605+
* The row ID is either the primaryKey value or the data record instance.
606+
*/
607+
public dragRowID = null;
608+
602609

603610
/**
604611
* Gets/Sets whether the rows are editable.

projects/igniteui-angular/src/lib/grids/row-drag.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class IgxRowDragDirective extends IgxDragDirective implements OnDestroy {
6060
this._clicked = false;
6161
return;
6262
}
63-
this.row.dragging = true;
63+
this.row.grid.dragRowID = this.row.rowID;
6464
this.row.grid.rowDragging = true;
6565
this.row.grid.markForCheck();
6666

@@ -143,7 +143,7 @@ export class IgxRowDragDirective extends IgxDragDirective implements OnDestroy {
143143

144144
private endDragging() {
145145
this.onTransitionEnd(null);
146-
this.row.dragging = false;
146+
this.row.grid.dragRowID = null;
147147
this.row.grid.rowDragging = false;
148148
this.row.grid.markForCheck();
149149
this._unsubscribe();

projects/igniteui-angular/src/lib/grids/row.directive.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ export class IgxRowDirective<T extends IgxGridBaseDirective & GridType> implemen
248248
/**
249249
* @hidden
250250
*/
251-
public dragging = false;
251+
public get dragging() {
252+
return this.grid.dragRowID === this.rowID;
253+
}
252254

253255
// TODO: Refactor
254256
public get inEditMode(): boolean {

0 commit comments

Comments
 (0)