정렬 뿐만 아니라 이것에 대한 ui.bootstrap
library :에서단지 내가이 <code>orderByField</code> 및 <code>reverseSort</code> 변수를 설정 한 다음과 같은 테이블 헤더가 현재 페이지
<uib-pagination total-items="totalItems"
ng-model="currentPage"
max-size="15" boundary-links="true"
items-per-page="numPerPage" class="pagination-sm">
</uib-pagination>
내 컨트롤러 난 그냥 기본 정렬을 사용하여 내 ng-repeat
$scope.paginate = function (value) {
var begin, end, index;
begin = ($scope.currentPage - 1) * $scope.numPerPage;
end = begin + $scope.numPerPage;
index = $scope.items.indexOf(value);
return (begin <= index && index < end);
};
$scope.sorter = function (item) {
return item[$scope.orderByField];
};
나의 종류에 적용되는 paginate
기능과 sorter
기능을 가지고,하지만 난 정렬 할 때, 그것은 서로 독립적으로 각 페이지를 정렬합니다. 어떻게 서로 의존하는 모든 페이지에 정렬을 적용합니까? (그리고 나서 사용자를 페이지 매김의 첫 번째 페이지로 보냅니다)?
필터를 전환하면 orderby가 작동하지 않습니다. –