我无法找到如何在我的ng-Table上隐藏页面切片的方法。在互联网上随处可见,必须作为最后资源来到这里。
请与我分享如何操作?
这是我的代码:
JS:
var applicationList = jsonResponse.entity.dashboardApplicationList;
$scope.applicationsTable = new ngTableParams({
page: 1,
count: 3,
noPager: true
}, {
total: applicationList.length,
getData: function ($defer, params) {
$scope.data = params.sorting() ? $filter('orderBy')(applicationList, params.orderBy()) : applicationList;
$scope.data = $scope.data.slice((params.page() - 1) * params.count(), params.page() * params.count());
$defer.resolve($scope.data);
}
});
HTML:
<table ng-table="applicationsTable" class="table table-striped back-silver-pointer table-dark" show-filter="applicationsTable">
<tbody class="back-light-blue font-weight-500 back-trans-imp text-white">
<tr ng-repeat="application in data" class="back-trans-imp">
<td data-title="'Status'"
class="text-center no-padding-left-imp no-border-top-imp" sortable="'status'" ng-click="showApplication(application)"
ng-attr-title="{{getApplicationStatusName(application.status)}}">
<span class="application-status-smaller"
ng-class="application.status == AppConstants.MOBIBRANCH_APPLICATION_STATUS_COMPLETED.code ? 'status_completed' :
application.status == AppConstants.MOBIBRANCH_APPLICATION_STATUS_SIGNED.code ? 'status_signed' :
application.status == AppConstants.MOBIBRANCH_APPLICATION_STATUS_SUBMITTED.code ? 'status_submitted' :
application.status == AppConstants.MOBIBRANCH_APPLICATION_STATUS_SAVED.code ? 'status_saved' : ''"></span>
<br>
<span class="font10 disp-block line-height-per50 text-capitalize">
{{(application.status == AppConstants.MOBIBRANCH_APPLICATION_STATUS_COMPLETED.code ? AppConstants.MOBIBRANCH_APPLICATION_STATUS_COMPLETED.name :
application.status == AppConstants.MOBIBRANCH_APPLICATION_STATUS_SIGNED.code ? AppConstants.MOBIBRANCH_APPLICATION_STATUS_SIGNED.name :
application.status == AppConstants.MOBIBRANCH_APPLICATION_STATUS_SUBMITTED.code ? AppConstants.MOBIBRANCH_APPLICATION_STATUS_SUBMITTED.name :
application.status == AppConstants.MOBIBRANCH_APPLICATION_STATUS_SAVED.code ? AppConstants.MOBIBRANCH_APPLICATION_STATUS_SAVED.name : 'unknown').toLowerCase();}}
</span>
</td>
<td data-title="'Product Type'"
class="text-bold vertical-align-middle no-border-top-imp"
sortable="'applicantFullName'" ng-click="showApplication(application)">{{application.applicantFullName}}</td>
<td data-title="'Creation'" ng-click="showApplication(application)"
class="text-center min-width-10em vertical-align-middle no-border-top-imp"
sortable="'createTime'">{{application.createTime | date:'dd MMM yyyy'}}</td>
</tr>
</tbody>
</table>
答案 0 :(得分:1)
new ngTableParams({
page: 1,
count: 3,
noPager: true,
counts: []
}