数据表对隐藏列进行排序和搜索

Jam*_*mie 3 jquery datatables

我有以下 Plunker,当我单击我的项目符号图表列中的排序时,它会在我的隐藏列上排序,但显示排序,以便我的项目符号图表的红线按 asc 和描述 我需要在我的代码中添加什么才能使其工作?

这是我的 plunker(随意分叉) https://plnkr.co/edit/u8k7MctfM055BTqvQ0I8?p=preview

这是我的数据表代码。

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

npe*_*son 6

“orderData”应该适合你。

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