1

我的列标题没有使用智能表正确排序。它们不是单独排序,而是一起排序。

<thead>
    <tr>
        <th st-sort="field" ng-repeat="field in stat.q">{{field}}</th>
    </tr>
</thead>

这是javascript。

stat.q = ["Who is the coolest?", "What is your favorite color?", "Pick a movie", "Where do you want to go?", "test rating"];   
4

2 回答 2

3

要使用 ng-repeat,您必须将大括号放在 {{field}} 周围:

<thead>
  <tr>
    <th st-sort="{{field}}" ng-repeat="field in stat.q">{{field}}</th>
  </tr>
</thead>
于 2015-11-11T02:25:07.790 回答
0

我认为您需要添加一个然后在元素<tbody>上使用 ng-repeat 。<tr>

源代码示例在这里: http: //lorenzofox3.github.io/smart-table-website/#section-sort

于 2015-07-31T21:10:41.683 回答