Skip to content

Commit

Permalink
fix(col-movable): prevent hidden columns triggering unnecessary re-or…
Browse files Browse the repository at this point in the history
…der event
  • Loading branch information
Dana Greenberg committed Mar 24, 2016
1 parent 68681d7 commit 644b324
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/features/move-columns/js/column-movable.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,23 @@
});
},
redrawColumnAtPosition: function (grid, originalPosition, newPosition) {
var columns = grid.columns;

if (originalPosition === newPosition) {
return;
}

var columns = grid.columns;
//check columns in between move-range to make sure they are visible columns
var i0 = Math.min(originalPosition, newPosition);
for (i0; i0 < Math.max(originalPosition, newPosition);i0++) {
if (columns[i0].visible) {
break;
}
}
if (i0 === Math.max(originalPosition, newPosition)) {
//no visible column found, column did not visibly move
return;
}

var originalColumn = columns[originalPosition];
if (originalColumn.colDef.enableColumnMoving) {
Expand Down

0 comments on commit 644b324

Please sign in to comment.