I have set up a table view with infinite scroll functionality. The table contains 2000 objects, but only shows 25 at a time. As the user scrolls to the bottom, it loads an additional 25 elements and so on. There is a "V" or "^" button in the header that should display the last 25 elements in descending order when clicked. However, I am having trouble implementing this feature with a filter. Can you provide guidance on how to achieve this?
For example, if the objects are initially loaded as A, B, D, C, K, N... T, Z
, clicking the button should show them as Z, Y, X, W, V, U... A or in ascending order like "A, B, C... Z"
You can view the code snippet below:
$scope.setSort = function(idx, reverse){
$scope.sortval = 'columns['+idx+'].value';
$scope.reverse = reverse;
};
HTML Code:
<div class="col col-center brd gray-20" ng-repeat="d in invoice_column_name | filter:{checked: true}">
<sort-header label="{{d.label}}" index="{{d.index}}" sort-exp="setSort(idx, reverse)"></sort-header>
EDIT
Update
To reiterate, I have 2000 objects displayed randomly, showing only 25 at a time. The goal is to sort these objects in both ascending and descending order before displaying them. Currently, the sorting is being done on the first 25 objects only. For better understanding, please refer to the updated Plunker.