<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<script src="https://code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.6/jquery.mousewheel.min.js"></script>
<script src="http://cdn.jsdelivr.net/underscorejs/1.6.0/underscore-min.js"></script>
<h1>Paginated Scrolling</h1>
<ul>
<li>The intention is to do a fast pagination in large tables.</li>
<li>You can scroll the table body using mouse.</li>
<li class="warn">The pagination without any filter is really fast. Unfortunately, the filter function is slowing down the scolling. I am looking for a solution in order to speed up it. Even with 1 million elements, the scroll will be fast, but impossible to use in conjunction with filters.</li>
<li>It's missing the scroll bar.</li>
</ul>
<div ng-app="myApp" ng-controller="MainCtrl">
Filter: <input ng-model="numberFilter"></input>
<button ng-click="addItem()">Add item</button>
<button ng-click="toogleAutomaticScrolling()">
Auto-Scroll: {{automaticScroll | uppercase}}
</button>
<table>
<thead>
<td>Key</td>
<td>Value</td>
</thead>
<tbody scroll>
<tr ng-repeat="d in filtered = (data | filter:numberFilter) |
pagination:currentPage:pageSize
track by d.key">
<td>{{d.key}}</td>
<td>{{d.value}}</td>
</tr>
</tbody>
</table>
<button ng-click="showFirstPage()">First</button>
<button ng-click="previousPage()">←</button>
<button ng-click="nextPage()">→</button>
<button ng-click="showLastPage()">Last</button>
<br/>
Page {{currentPage+1}} of {{numberOfPages()}}
<br/>
Page Size: <input ng-model="pageSize" style="width: 4em"></input>
<br/>
Data Size: {{data.length}}
<br/>
Filtered...