I am trying to disable search on a specific column. Im using this server side angular.
https://l-lin.imtqy.com/angular-datatables
usually in jquery i can just:
columns:[{data:"foo", name:"foo", searchable:false}]
I tried using:
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('ajax', {
url: apiRoot + 'merchant-list'
})
.withDataProp('data')
.withOption('serverSide', true)
.withOption('order', [0, 'asc'])
$scope.dtColumns = [
DTColumnBuilder.newColumn('name', 'Name'),
DTColumnBuilder.newColumn('type', 'Type'),
DTColumnBuilder.newColumn('username', 'Username'),
]
$scope.dtColumnDefs = [
DTColumnDefBuilder.newColumnDef(0),
DTColumnDefBuilder.newColumnDef(1).withOption('searchable', false),
DTColumnDefBuilder.newColumnDef(2).withOption('searchable', false)
]
seems to work, but the columnDef position is incorrect. when I add newColumnDef (1) for the search to false, the column that should not be the search should be the second, but it seems to disable the first column.
Is there a way to disable the search for a specific column and order it?
thanks
Edit: I tried "ordering", false and notvisible works on columnDef 0. It seems that only searchability does not work.
source
share