【发布时间】:2015-09-22 08:17:38
【问题描述】:
我在过滤器下拉列表中添加了默认选项“全部”以显示所有结果,但是当我使用某个组名称过滤然后尝试使用“全部”过滤时,没有显示任何结果。如何在选择所有选项时显示所有结果?
<input type="text" ng-model="search" class="input-control width-100" />
<select ng-model="group" ng-options="gp.groupID as gp.groupName for gp in groups" class="input-control width-100"><option value="" selected>All</option></select>
<table id="tbl-holidaylist" class="table table-striped table-bordered">
<thead>
<th width="40%">Type</th>
<th width="40%">Group</th>
</thead>
<tbody>
<tr ng-repeat="tp in types |filter:{'groupID':group}|filter:search">
<td>{{ tp.ExpenseTypeName }}</td>
<td>{{ tp.ExpenseGroupName }}</td
</tr>
</tbody>
</table>
【问题讨论】:
-
我认为您应该清除过滤器而不是尝试过滤“全部”。
-
显示您合并
All的代码。 -
-
不知何故没有正确更新..现在你可以看到完整的代码..
标签: javascript angularjs