grid.init = function() {
grid.offset = 0;
- grid.limit = Number($scope.pageSize) || 25;
$scope.items = [];
$scope.showGridConf = false;
grid.totalCount = -1;
grid.persistKey = $scope.persistKey;
delete $scope.persistKey;
+ var stored_limit = 0;
+ if (grid.persistKey) {
+ var stored_limit = Number(
+ egCore.hatch.getLocalItem('eg.grid.' + grid.persistKey + '.limit')
+ );
+ }
+ grid.limit = Number(stored_limit) || Number($scope.pageSize) || 25;
+
grid.indexField = $scope.idField;
delete $scope.idField;
}
controls.setLimit = function(limit) {
+ if (grid.persistKey)
+ egCore.hatch.setLocalItem('eg.grid.' + grid.persistKey + '.limit', limit);
grid.limit = limit;
}
controls.getLimit = function() {
}
$scope.limit = function(l) {
- if (angular.isNumber(l))
+ if (angular.isNumber(l)) {
+ if (grid.persistKey)
+ egCore.hatch.setLocalItem('eg.grid.' + grid.persistKey + '.limit', l);
grid.limit = l;
+ }
return grid.limit
}