【发布时间】:2016-08-31 18:30:01
【问题描述】:
我有类似的数据
{ column : [a,b,c], data : [["a",1,2],["b",4,5],["c",3,2]]}
表结构
<thead>
<tr>
<th ng-repeat="n in column" ng-click="click($index)">n</th>
</tr>
</thead>
<tr ng-repeat="i in data | orderBy:sortType:sortReverse ">
<td ng-repeat="j in i">i</td>
</tr>
这里怎么做排序逻辑??
【问题讨论】:
-
你能再具体一点吗?你想怎么排序?
-
@UjjwalOjha 在单击 th(根据标题)时进行排序,就像通常在数据表中所做的那样
-
您想在单击列“a”时按索引 0 排序,当单击列“b”时按索引 1 排序等等?
-
@Sarathy 是的
标签: javascript angularjs sorting