Jamie
Jamie

Reputation: 436

Datatables Sort and Search on Hidden Column

I have the following Plunker, I am trying to get it to where when I click the sort in my column that has my bullet charts it sorts on my hidden column instead but displays the sort so that my bullet chart's red line is sorted both asc and desc. What do I need to add to my code to get this to work?

Here is my plunker (feel free to fork) https://plnkr.co/edit/u8k7MctfM055BTqvQ0I8?p=preview

Here is my code for the Datatable.

$(document).ready(function(){
 $('#test-table').DataTable({
  paging: false,
  info:false,
  "columnDefs":[{"visible": false, "targets":3}]
 })
});

Upvotes: 3

Views: 6766

Answers (1)

npearson
npearson

Reputation: 702

"orderData" should work for you.

$(document).ready(function(){
 $('#test-table').DataTable({
  paging: false,
  info:false,
  "columnDefs":[
   {"orderData": 3, "targets": 2},
   {"visible": false, "targets":3}]
 })
});

Upvotes: 6

Related Questions