moveColumn service works incorrectly if user pins a column
go to http://ui-grid.info/docs/#/tutorial/401_AllFeatures pin a column to the left (ie address.street) try to move a column after its original position (like address.city) the wrong column gets moved.
or move a column before its original position (like name) and the column gets moved to the wrong position
I havent looked into this very deeply but I think it is because of how the number of columns hidden by scroll is calculated:
var renderedColumns = $scope.grid.renderContainers['body'].renderedColumns;
//This method will calculate the number of columns hidden in lift due to scroll
//renderContainer.prevColumnScrollIndex could also have been used but this is more accurate
var scrolledColumnCount = 0;
var columns = $scope.grid.columns;
for (var i = 0; i < columns.length; i++) {
if (columns[i].colDef.visible && columns[i].colDef.name !== renderedColumns[0].colDef.name) {
scrolledColumnCount++;
}
else {
break;
}
}
renderedColumns doesnt include the pinned columns but grid.columns does so all columns pinned are automatically considered "hidden columns"
@jpuri: have you seen this one?
Hi @MeMea66 ,
Thanks for bringing this up. I will look into this.
PR #2351 should fix the issue.
No response after 2 weeks; assuming problem was fixed. Closing.