i have a strange problem with pagination.
I have an ng-controller getting data from JSON array populated by Web Service collecting date from database. When i add a new elemnt in database and update JSON data, i don't see this update reflected on the view. To avoid this i had to refer the JSON array by named controller. Now i see the view updated after the db update and JSON data refresh, but pagination is not working anymore, i see all the data expanded without any pagination (before i had 5 items per page).
I'm using blur admin template, based on bootstrap.
This is my html code, i had to introduce "BPC" as prefix for my list of data "ServiceCallList".
<tr ng-repeat="item in BPC.ServiceCallList">
<td class="table-id">{{item.callID}}</td>
<td class="table-id">{{item.subject}}</td>
<!--<td class="table-id">{{item.customer}}</td>
<td class="table-id">{{item.custmrName}}</td>-->
<td class="table-id">{{item.itemCode}}</td>
<!--<td class="table-id">{{item.itemName}}</td>-->
<td class="table-id">{{item.internalSN}}</td>
<!--<td class="table-id">{{item.manufSN}}</td>-->
<!--<td class="table-id">{{item.contractID}}</td>-->
<td class="table-id">{{item.createDate | date:'dd-MM-yyyy'}}</td>
<td class="table-id">{{item.AssignDate | date:'dd-MM-yyyy'}}</td>
<!--data-toggle="modal" ng-click="open('app/pages/ui/modals/modalTemplates/basicModal.html', 'md')"-->
<!--<td class="table-id"><button class="status-button btn btn-xs btn-info" ui-sref="servicecall({callID: item.callID, isNew: false})">INFO</button></td>-->
<td class="table-id"><button class="status-button btn btn-xs btn-info" data-toggle="modal" ng-click="showmodal(item)">VIEW</button></td>
</tr>
<tfoot>
<tr>
<td colspan="11" class="text-center">
<!--<pagination items-per-page="BPC.pageSize" ng-model="BPC.currentPage" max-size="5" class="pagination-sm"></pagination>-->
<div st-pagination="" st-items-by-page="5" st-displayed-pages="5"></div>
</td>
</tr>
</tfoot>
In my controller I had to do this
var BPC = this;
BPC.ServiceCallList = [];
And my function to load ServiceCallList is this
// Carica chiamate di servizio per il cliente selezionato
loadGenericList($scope.CardCode, 'SERVICECALLS', $scope.docType).then(
function (response) {
$scope.dataLoading = true;
$scope.documentsData = response;
angular.forEach($scope.documentsData, function (value) {
BPC.ServiceCallList.push(value);
});
}
);
I think that could be something related to the scope, but cant' figure out what could be.
Thanks for any help.