我使用DataTable 1.10,并且我想使用https://datatables.net/extensions/select/examples/initialisation/checkbox.html。
现在我的代码是:
pidcat com.you.package -t myTag
使用“ works”,但是将复选框放在第一行中,该行中已经有数据。
我不知道是否必须定义一个空列,但是如何在服务器端执行此操作?
我尝试过:
$('#table').DataTable({
processing: true,
serverSide: true,
ajax: '{{ route('datatable.getData') }}',
dom: '<"html5buttons"B>lTfgitp',
stateSave: true,
columnDefs: [ {
orderable: false,
className: 'select-checkbox',
targets: 0
}],
select: {
style: 'os',
selector: 'td:first-child'
},
order: [[ 1, 'asc' ]],
columns: [
@foreach ($columns as $column)
{!! '{ data: "'. ($column['relation'] ?? $column['data']) .'", name: "'. $column['name'] .'", searchable: '. ($column['searchable'] ?? 'true') .'},' !!}
@endforeach
]
});
但是我收到了错误的ajax。有可能吗?