【发布时间】:2014-06-26 20:16:26
【问题描述】:
我正在使用 NG-table 显示过滤后的数据,但我遇到了分页问题。
这是结构:
HTML:
<li ng-repeat="(type, value) in winetypes">
<input type="checkbox" ng-model="winetypes[type]"/> {{type}}
</li>
<ul>
<li ng-repeat="wine in data | winetypefilter:winetypes">
{{wine.name}} is a {{wine.type}} with {{wine.style}} style from {{wine.country}}
</li>
</ul>
<p><strong>Page:</strong> {{tableParams.page()}}</p>
<p><strong>Count per page:</strong> {{tableParams.count()}}</p>
<table ng-table="tableParams" class="table">
<tr ng-repeat="user in filtered = ($data | winetypefilter:winetypes)">
<td data-title="'Name'">{{user.name}}</td>
</tr>
</table>
过滤和分页工作正常,但如果选中红色复选框(红酒),所有过滤的红酒都会出现在经典列表中(未链接到 ng-table)。
通常在 ng-table 创建的表格中,每个页面应该出现 10 个项目,但事实并非如此(见下图)
这里是演示: http://plnkr.co/edit/9xTdaQ2bTfY0jQpZAL1T?p=preview
有什么办法可以解决这个问题??
【问题讨论】:
标签: angularjs filter pagination ngtable