【发布时间】:2016-06-17 19:48:53
【问题描述】:
有没有办法为包含非文本数据的列创建自定义排序?
这是一个快照:
我想按图标符号排序。
附:这两个图标都使用ng-if 和数据集中的布尔值显示。
编辑:我正在使用 Angular 显示数据的方式。
<table datatable="ng" dt-options="dtOptionsLoginHistory" dt-column-defs="dtColumnDefsLoginHistory"
class="table table-striped row-border hover"
width="100%">
<thead>
<tr>
<th>Success</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="entry in entries">
<td style="width: 10%;">
<i ng-if="!entry.failed" class="fa fa-check" style="color: green;"></i>
<i ng-if="entry.failed" class="fa fa-times" style="color: red;"></i>
</td>
</tr>
</tbody>
</table>
【问题讨论】:
-
请准确说明您是如何渲染表格的。
-
@davidkonrad 我更新了我的问题。
-
@davidkonrad 你会这么好心看看我的另一个数据表问题,因为你可能非常了解这个库吗?这是链接:stackoverflow.com/questions/38032004/…