Skip to content

Commit

Permalink
Merge pull request #821 from dpangier/master
Browse files Browse the repository at this point in the history
Fixed issue where clearing the filter is slow after a sort operation.  T...
  • Loading branch information
roblarsen committed Nov 15, 2013
2 parents c364028 + edb75f0 commit 06275bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/classes/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ var ngGrid = function ($scope, options, sortService, domUtilityService, $filter,
newRange = new ngRange(Math.max(0, rowIndex - EXCESS_ROWS), rowIndex + self.minRowsToRender() + EXCESS_ROWS);
} else {
var maxLen = $scope.configGroups.length > 0 ? self.rowFactory.parsedData.length : self.data.length;
newRange = new ngRange(0, Math.max(maxLen, self.minRowsToRender() + EXCESS_ROWS));
newRange = new ngRange(0, Math.min(maxLen, self.minRowsToRender() + EXCESS_ROWS));
}
self.prevScrollTop = scrollTop;
self.rowFactory.UpdateViewableRange(newRange);
Expand Down
1 change: 1 addition & 0 deletions src/directives/ng-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
$scope.$parent.$watch(options.data, dataWatcher);
$scope.$parent.$watch(options.data + '.length', function() {
dataWatcher($scope.$eval(options.data));
$scope.adjustScrollTop(grid.$viewport.scrollTop(), true);
});
}

Expand Down

0 comments on commit 06275bd

Please sign in to comment.