Skip to content

Commit

Permalink
Merge pull request #2379 from Servoy/row_inserts_before_current_fix
Browse files Browse the repository at this point in the history
regression fix for: #2357 scrolling with large amount of columns,columns disappear after sort
  • Loading branch information
PaulL1 committed Dec 19, 2014
2 parents 079f358 + b75df2f commit 82074e8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/js/core/factories/GridRenderContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,15 @@ angular.module('ui.grid')

var newRange = [];
if (rowCache.length > self.grid.options.virtualizationThreshold) {
// Have we hit the threshold going down?
if (self.prevScrollTop < scrollTop && rowIndex < self.prevRowScrollIndex + self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
return;
}
//Have we hit the threshold going up?
if (self.prevScrollTop > scrollTop && rowIndex > self.prevRowScrollIndex - self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
return;
if (!(typeof(scrollTop) === 'undefined' || scrollTop === null)) {
// Have we hit the threshold going down?
if (self.prevScrollTop < scrollTop && rowIndex < self.prevRowScrollIndex + self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
return;
}
//Have we hit the threshold going up?
if (self.prevScrollTop > scrollTop && rowIndex > self.prevRowScrollIndex - self.grid.options.scrollThreshold && rowIndex < maxRowIndex) {
return;
}
}

var rangeStart = Math.max(0, rowIndex - self.grid.options.excessRows);
Expand Down

0 comments on commit 82074e8

Please sign in to comment.