You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for the component, very helpful. I have a suggestion for onDragOverEventListener. Instead of deciding if moving above or below a row via the offset, I think the following is more straight forward and comprehensible for the user. The way it is built now, the decision if above or below changes when moving over the middle of a row, which I personally think is too "jumpy":
when on a row which is above the row being dragged, you want to move it above that row
when on a row which is below the row being dragged, you want to move it below that row
when on the same row, you don't want to move the row.
So instead of checking for (offset < this.offsetHeight / 2), I did the following:
onDragOverEventListener: function (e) {
...
uiGridDraggableRowsCommon.toIndex = data().indexOf($scope.$parent.$parent.row.entity);
if (uiGridDraggableRowsCommon.toIndex < uiGridDraggableRowsCommon.fromIndex) {
...
} else if (uiGridDraggableRowsCommon.toIndex > uiGridDraggableRowsCommon.fromIndex) {
...
}
else {
$element.removeClass(uiGridDraggableRowsConstants.ROW_OVER_ABOVE_CLASS);
$element.removeClass(uiGridDraggableRowsConstants.ROW_OVER_BELOW_CLASS);
}
Any problems this could create?
Thank you
The text was updated successfully, but these errors were encountered:
By the way, the logic of moving the row inside the onDropEventListener function has to be changed accordingly. I also removed the $element classes in the onDropEventListener, because it seemed that in some situations they weren't removed.
Hi, thanks for the component, very helpful. I have a suggestion for onDragOverEventListener. Instead of deciding if moving above or below a row via the offset, I think the following is more straight forward and comprehensible for the user. The way it is built now, the decision if above or below changes when moving over the middle of a row, which I personally think is too "jumpy":
So instead of checking for (offset < this.offsetHeight / 2), I did the following:
onDragOverEventListener: function (e) {
...
uiGridDraggableRowsCommon.toIndex = data().indexOf($scope.$parent.$parent.row.entity);
if (uiGridDraggableRowsCommon.toIndex < uiGridDraggableRowsCommon.fromIndex) {
...
} else if (uiGridDraggableRowsCommon.toIndex > uiGridDraggableRowsCommon.fromIndex) {
...
}
else {
$element.removeClass(uiGridDraggableRowsConstants.ROW_OVER_ABOVE_CLASS);
$element.removeClass(uiGridDraggableRowsConstants.ROW_OVER_BELOW_CLASS);
}
Any problems this could create?
Thank you
The text was updated successfully, but these errors were encountered: