mirror of https://github.com/portainer/portainer
fix(app): paginatedItemLimit now retrieved for datables extending GenericDatatableController
parent
79802d1999
commit
e10cbbdd46
|
@ -1,11 +1,11 @@
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.controller('GenericDatatableController', ['PaginationService', 'DatatableService',
|
.controller('GenericDatatableController', ['PaginationService', 'DatatableService', 'PAGINATION_MAX_ITEMS',
|
||||||
function (PaginationService, DatatableService) {
|
function (PaginationService, DatatableService, PAGINATION_MAX_ITEMS) {
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
selectAll: false,
|
selectAll: false,
|
||||||
orderBy: this.orderBy,
|
orderBy: this.orderBy,
|
||||||
paginatedItemLimit: PaginationService.getPaginationLimit(this.tableKey),
|
paginatedItemLimit: PAGINATION_MAX_ITEMS,
|
||||||
displayTextFilter: false,
|
displayTextFilter: false,
|
||||||
selectedItemCount: 0,
|
selectedItemCount: 0,
|
||||||
selectedItems: []
|
selectedItems: []
|
||||||
|
@ -65,5 +65,6 @@ function (PaginationService, DatatableService) {
|
||||||
function setDefaults(ctrl) {
|
function setDefaults(ctrl) {
|
||||||
ctrl.showTextFilter = ctrl.showTextFilter ? ctrl.showTextFilter : false;
|
ctrl.showTextFilter = ctrl.showTextFilter ? ctrl.showTextFilter : false;
|
||||||
ctrl.state.reverseOrder = ctrl.reverseOrder ? ctrl.reverseOrder : false;
|
ctrl.state.reverseOrder = ctrl.reverseOrder ? ctrl.reverseOrder : false;
|
||||||
|
ctrl.state.paginatedItemLimit = PaginationService.getPaginationLimit(ctrl.tableKey);
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -54,10 +54,10 @@ angular.module('portainer.app')
|
||||||
localStorageService.remove('JWT');
|
localStorageService.remove('JWT');
|
||||||
},
|
},
|
||||||
storePaginationLimit: function(key, count) {
|
storePaginationLimit: function(key, count) {
|
||||||
localStorageService.cookie.set('pagination_' + key, count);
|
localStorageService.set('datatable_pagination_' + key, count);
|
||||||
},
|
},
|
||||||
getPaginationLimit: function(key) {
|
getPaginationLimit: function(key) {
|
||||||
return localStorageService.cookie.get('pagination_' + key);
|
return localStorageService.get('datatable_pagination_' + key);
|
||||||
},
|
},
|
||||||
getDataTableOrder: function(key) {
|
getDataTableOrder: function(key) {
|
||||||
return localStorageService.get('datatable_order_' + key);
|
return localStorageService.get('datatable_order_' + key);
|
||||||
|
|
Loading…
Reference in New Issue