<div id="collapseThree-2" class="panel-collapse collapsexpanded="false">
<table class="table table-hover hd-bg table-bordered;sortable">
<thead align="center">
<tr>
<th>Request ID</th>
<th>Request Type</th>
<th>Initiator</th>
<th>Product</th>
<th>Version</th>
<th>Submission Date</th>
<th>Stage</th>
<tr>
<tbody ng-repeat = "x in requestData">
<td ng-bind = "x.id"></td>
<td ng-bind = "x.type_of_request"></td>
<td ng-bind = "x.initiator_name"></td>
<td ng-bind = "x.product_name"></td>
<td ng-bind = "x.product_version"></td>
<td ng-bind = "x.submission_date"></td>
<td ng-bind = "x.status_flag"></td>
</tbody>
</thead>
</table>
</div>在这里,我使用的是sottable.js,但仍然无法在columns.As上找到排序选项,我使用的是sorttable.js,因此在默认情况下,它需要提供表的列的排序选项。
发布于 2018-04-04 15:39:09
你需要像这样绑定对象的数组
$scope.sortColumn = {
Column: 'c1', // name of column
reverse: false // order
};html代码:-
<th ng-repeat="object in objects">
<a ng-click="columnSort.sortColumn=objects[$index];columnSort.reverse=!columnSort.reverse">{{ objects[$index] }}</a>
</th>please find fiddle
https://stackoverflow.com/questions/49645179
复制相似问题