javascript - 智能表格无法正确排序

标签 javascript sorting angularjs-ng-repeat smart-table

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

<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"];   

最佳答案

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

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

关于javascript - 智能表格无法正确排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31455383/

相关文章:

javascript - ng-repeat 在 neSTLed 数据更改后不更新

javascript - 在路由更改不起作用后取消angularjs超时

php - 防止 php 在 pre 标签之间渲染/执行

javascript - 使用Canvas,如何绘制用户输入X次的形状?

mysql - 按出现次数对mysql进行排序

arrays - 如何在 Swift 中对具有关联值的枚举数组进行排序?

javascript - 通过jquery制作元素 "css-absolute"时奇怪的跳转

javascript - html/css : center buttons in a div

linux - cut 中的定界符是什么意思,为什么在此命令中它排序两次?

javascript - Angular JS - 清除后文本框未更新