去往hide empty
或去往的最佳方式null comumns
是Yajra Datatables
:
var table = $('.data-table').DataTable({
processing: true,
serverSide: true,
ajax: "{{ route('any.route') }}",
columns: [
// How to Hide any of these columns if its data is empty or null?
// for exampe I want to hide mname column ?
// visible: what condition for example !!!!
{data: 'fname', name: 'fname'},
{data: 'mname', name: 'mname'},
{data: 'lname', name: 'lname'},
....
]
});
每当有任何数据时,我如何隐藏th
。例如,使用,我应该使用什么条件来测试is或table
empty or null
visible:
data:
empty
null