1
我正在使用角度數據表,我只有一列。如何禁用Angular Datatables中的初始數據排序?
當我綁定它時,數據以一個順序排列,而我想按照它的順序顯示它。
有人可以請幫忙。
控制器:
var vm = this;
vm.dtOptions = DTOptionsBuilder.newOptions()
.withButtons([
'print',
'pdfHtml5',
]);
vm.dtColumnDefs = [
DTColumnDefBuilder.newColumnDef(0).notSortable()
];
HTML:
<div ng-controller="formViewController as frmView">
<table datatable="ng" dt-options="frmView.dtOptions" dt-column-defs="frmView.dtColumnDefs" class="row-border hover">
<thead>
<tr>
<td>
{{Title}}
</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="plugin in newArray track by $index">
<td>
//Content
</td>
</tr>
</tbody>
</table>
</div>
http://stackoverflow.com/questions/31027497/in-angular-js-how-to-disable-column-sort-feature-for-selected-columns –
我已經有他們說的,我想禁用排序,即上升 - 下降 –