当我在Datatables中使用搜索框时,它会自动搜索不可见的列。
是否有可能禁用此功能?我只需要过滤可见列。
table_advanced = $('#advanced').DataTable({
"ajax": '{{ route('xxx', ['advanced']) }}',
columns: [
{
name: 'xx',
data: 'xx',
visible: false,
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
$(nTd).html("<img src='{{ url('/xxx/') }}/"+oData.xxx+"' style='height:40px'>");
}
},
{
name: 'xx',
data: 'xx',
visible: true,
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
$(nTd).html("<a href='{{ url('/xxx/') }}/"+oData.xxx+"'>"+oData.name+"</a>");
}
},
{ name: 'xx', data: 'xx', visible: true },
],
search: false,
colReorder: true,
"colVis": {
"buttonText": "Change columns"
},
//"dom": 'BC<"clear">lfrtip',
buttons: [
'colvis'
],
dom:
"<'row'<'col-sm-4'l><'col-sm-3 text-center'BC><'col-sm-5'f>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
});