Reputation: 572
This is what the pagination currently gives (The total # of items returned by the api):
The Problem is I am filtering the data using the columndefs.
field: 'claimed', displayName: 'Claimed', width: '8%', visible: true,
filter: {
term: false,
type: uiGridConstants.filter.SELECT,
selectOptions: [{value: true, label: true}, {value: false, label: false}]
The result of this filter is a limited # of items. In the current case '3'.
I believe the item count is linked to 'grid.options.totalitems'.
The count is correct when I change data or select a filter.
It is wrong when the page first loads.
I am using angular ui grid and django to set up my project. I am trying to fix this within my controller that handles the grid setup.
Thanks for any help you can offer.
Upvotes: 1
Views: 1145
Reputation: 572
The fix that worked for me: On the $http.get that populates the grid info I had to add:
$scope.gridApi.grid.queueGridRefresh();
In the controller, here's the code with no errors.
$scope.gridOptions = {
onRegisterApi: function (gridApi) {
$scope.gridApi = gridApi;
gridApi.rowEdit.on.saveRow($scope, $scope.saveRow);
$http.get('/api/this/?format=json')
.success(function (data) {
$scope.gridOptions.data = data;
$scope.gridApi.grid.queueGridRefresh();
}); //Ends http.get
},
And I had to put the http.get inside of the 'onRegisterApi'.
Upvotes: 0
Reputation: 22733
If you want to use the table then you need to write everything of your own.
Otherwise you can use the ng-grid
which already have all the features.
Upvotes: 0