For some reason, my pagination is always resetting to 1 as the selected page, even though the result comes back from the server with the proper data in the results EG Records 31 - 45) and populate properly in the smart table. What could cause it to always reset the selected page in the pagination view to page 1? Is there a way to say what the selected page is?
Thanks in advance
Controller Method
$scope.getData = function (tableState) {
var pagination = tableState.pagination;
var start = pagination.start || 0;
var number = pagination.number || 10;
$scope.users = UserServicePaging.query({offset: start});
$scope.users.$promise
.then (function (result) { //success
$scope.users = result[0].results;
$scope.rowCollection = $scope.users;
$scope.displayedCollection = [].concat($scope.rowCollection);
tableState.pagination.numberOfPages = Math.ceil(parseInt(result[0].records.total)) / 15;
tableState.pagination.totalItemCount = Math.ceil(parseInt(result[0].records.total));
},
function (error) {//fail
})
.finally(function() {
});
}
Table Header:
<table st-table="displayedCollection" st-safe-src="rowCollection" st-pipe="getData" class="table table-striped">
Table Footer
<td colspan="5" class="text-center">
<div st-pagination="" st-items-by-page="itemsByPage" st-displayed-pages="10"></div>
</td>
st-safe-src
when usingst-pipe
– Bergeron