【发布时间】:2017-08-15 22:58:43
【问题描述】:
我有一个带有 option1 和 option2 的选择框; 我有一个包含 column1、column2、column3、column4 的表。 Column2 和 column3 是数字字段。
1) 我希望我在选择框中选择 option1,该表显示 column2 中所有 fileld 均 >0 且 column3 的所有字段 == 0 的行
2) 我希望我在选择框中选择了 option2,表格显示 column2 中的所有 fileld 为 ==0 且 column3 的所有字段 > 0 的行
例子
select class="form-control" name="optionsSelect" ng-model="ctrl.table.filterParams.optionSelect"
ng-options="option for option in ctrl.ctx.option">
</select>
<div class="bt-table">
<table class="table table-striped" ng-table="ctrl.tableParams" id="exampleTable">
<thead>
<tr>
<th ng-repeat="item in items"><p ng-bind-html="item"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in ctrl.table.data">
<td><a>{{item.column1}}</a></td>
<td>{{item.column2}}</td>
<td>{{item.column3}}</td>
<td>{{item.column4}}</td>
<td>{{item.column5| date: 'dd/MM/yyyy'}}</td>
<td>{{item.column6| currency : "" | currencyformat }}</td>
</span></td>
<td>{{item.column7}}</td>
<td>
{{item.column8}}
</td>
</tr>
</tbody>
</table>
感谢您的帮助
【问题讨论】:
-
你能用你的控制器代码发布一个工作的 jsfiddle 吗?
标签: angularjs json angularjs-directive angularjs-scope