angularjs - 获取过滤的 angularJS 表的当前行数
问题描述
我有一个带有搜索过滤器的表。无论表格是否应用了过滤器,我都需要知道当前显示的行数。
<table class="table table-hover" id="weekly_report_table" ng-app="TableFilterApp" ng-controller="TableFilterController">
<thead>
<tr>
<th></th>
<th>Number</th>
<th>Name</th>
<th>State</th>
</tr>
</thead>
<tbody>
<tr id="search_row">
<td><input class="search_string" placeholder="Search " ng-model="ctiFilter.number"></td>
<td><input class="search_string" placeholder="Search " ng-model="ctiFilter.name"></td>
<td><input class="search_string" placeholder="Search " ng-model="ctiFilter.state"></td>
</tr>
<tr id="datarow" dir-paginate="report in data.recent_flash | filter:ctiFilter | itemsPerPage: pageSize" >
<td><a ng-click="smmReport(report.sys_id)"> {{report.number}} </a></td>
<td>{{report.name}}</td>
<td>{{report.state}}</td>
</tr>
</tbody>
</table>