I'm using angular-datatables with server side processing, and it is not allowing me to perform sorting on columns.
This is my HTML:
<table class="table table-striped table-bordered" datatable="" dt-column-defs="dtColumnDefs" dt-options="dtOptions">
<thead>
<tr>
<th translate>NAME</th>
<th translate>BASIC_UNIT</th>
<th translate>STATUS</th>
</tr>
</thead>
</table>
This is my JS in the corresponding controller:
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withBootstrap()
.withOption('order', [0, 'asc'])
.withOption('ajax', {
url: 'path/to/server/resource',
type: 'POST'
})
.withDataProp('data')
.withOption('processing', true)
.withOption('serverSide', true)
.withPaginationType('full_numbers');
$scope.dtColumnDefs = [
DTColumnDefBuilder.newColumnDef(0)
.withOption('sName', 'name')
DTColumnDefBuilder.newColumnDef(1)
.withOption('sName', 'basic_unit')
.withOption('bSearchable', false)
.withOption('bSortable', false),
DTColumnDefBuilder.newColumnDef(2)
.withOption('sName', 'status')
.withOption('bSearchable', false)
.withOption('bSortable', false)
];
Does anyone know if I'm missing something?.