通过使用 Angular 智能表,如何使用偏移值获取结果集。
例如,我在数据库中有 100 条记录
我正在使用智能表管道/ajax 插件来显示记录。
如何使用这个实现。
<div class="table-container" ng-controller="pipeCtrl as mc">
<table class="table" st-pipe="mc.callServer" st-table="mc.displayed">
<thead>
<tr>
<th st-sort="id">id</th>
<th st-sort-default="reverse" st-sort="name">name</th>
<th st-sort="age">age</th>
<th st-sort="saved">saved people</th>
</tr>
<tr>
<th><input st-search="id"/></th>
<th><input st-search="name"/></th>
<th><input st-search="age"/></th>
<th><input st-search="saved"/></th>
</tr>
</thead>
<tbody ng-show="!mc.isLoading">
<tr ng-repeat="row in mc.displayed">
<td>{{row.id}}</td>
<td>{{row.name}}</td>
<td>{{row.age}}</td>
<td>{{row.saved}}</td>
</tr>
</tbody>
<tbody ng-show="mc.isLoading">
<tr>
<td colspan="4" class="text-center"><div class="loading-indicator"></div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="text-center" st-pagination="" st-items-by-page="5" colspan="4">
</td>
</tr>
</tfoot>
</table>
</div>
http://lorenzofox3.github.io/smart-table-website/
Plunker 中的代码
http://plnkr.co/edit/wzUHcc9PBF6tzH8iAEsn?p=preview
最佳答案
您需要添加 st-safe-src="tablecollection"
以及 st-table=tablerow
然后,
<tr ng-repeat="row in tablerow">
FMI,
来源:Client side pagination not working in smart table
关于使用智能表的angularjs分页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30164481/