Reputation: 1530
I am trying to disable sorting 'Empty' column.
I'm adding bSortable: false, targets: [0], orderable: false
, but no luck.
$("#example").DataTable({
aaSorting: [],
bPaginate: true,
aaData: _vIntArrData,
aoColumns: [{
sTitle: ""
}, {
sTitle: "Category"
}, {
sTitle: "Name"
}, {
sTitle: "Audience / Coverage"
}],
columnDefs: [{
bSortable: false,
targets: [0],
orderable: false
}]
});
What is wrong? Any help is appreciated.
Upvotes: 1
Views: 72
Reputation: 7980
Use your code like below:
$("#example").DataTable({
"aaSorting": [],
"bPaginate": true,
aaData: _vIntArrData,
columns: [{
'sTitle': ''
}, {
'sTitle': 'Category'
}, {
'sTitle': 'Name'
}, {
'sTitle': 'Audience / Coverage'
}],
"columnDefs": [{
'bSortable': false,
'aTargets': [0],
'orderable': false
}],
});
Upvotes: 1
Reputation: 50291
You can try by adding bSortable
to aoColumns
aoColumns: [{
sTitle: "",
"bSortable": false
}
Upvotes: 0