小编Sus*_*rut的帖子

在angularjs中排序或重新排列表格的行(拖放)

我想要在表格中重新排列行的功能(使用拖放操作排序行). 行排列的索引也应该在模型中改变.

我怎样才能做类似的事情:http://jsfiddle.net/tzYbU/1162/ 使用Angular Directive?

我正在生成表格:

<table id="sort" class="table table-striped table-bordered">
  <thead>
    <tr>
      <th class="header-color-green"></th>
      <th ng-repeat="titles in Rules.Titles">{{titles.title}}</th>
    </tr>
  </thead>
  <tbody ng-repeat="rule in Rules.data">
    <tr>
      <td class="center"><span>{{rule.ruleSeq}}</span></td>
      <td ng-repeat="data in rule.ruleData">{{statusArr[data.value]}}</td>
    </tr>
  </tbody>
</table>
Run Code Online (Sandbox Code Playgroud)

javascript html-table angularjs angularjs-directive

26
推荐指数
3
解决办法
6万
查看次数

多状态按钮,如在angularJS中切换

我想在表中实现一个功能,用户可以通过单击它来设置单元格的值.可以说3-4个状态,也是附加到它的ng模型.

我在angularjs中查找了切换按钮,但它们仅仅是开/关类型.

简而言之; 单击该按钮将值设置为:活动,非活动,排除寻找具有多个状态的解决方案.任何帮助都非常感谢.

javascript angularjs

4
推荐指数
1
解决办法
5890
查看次数