gyrocode/jquery-datatables-checkboxes

Plugin overrides my defined checkboxes in view

BrunoAderaldo opened this issue · 2 comments

in my view thead:

<input class="checkall" type="checkbox" name="_method" value="checkall" />

result:
<input type="checkbox" class="dt-checkboxes">

In tbody (foreach of symfony)
<input class="checkbox_index" type="checkbox" value="{{audio.getId()}}"/>

result:
<input type="checkbox" class="dt-checkboxes">

tables.js
table.DataTable({ 'iDisplayLength': 10, 'order': [], 'responsive': true, 'aoColumnDefs': [ { 'bSortable': false, 'aTargets': [-1, 0] }, // Disable sorting in first and last column (Checkbox and actions) { 'width': '2%', 'targets': 0 }, // Usually the first column is the checkbox { 'width': '4%', 'targets': 1 }, // Usually the second column is ID { responsivePriority: 1, targets: -1 }, // Set last column (usually actions) with priority 1 { responsivePriority: 2, targets: 2 }, // Set last column (usually actions) with priority 1 ...shouldCheck(table) ], 'dom': '<"row"<"col-sm-12"<"pull-left"f>tr>>' + '<"row"<"col-sm-4"l><"col-sm-4 info-dtable"i><"col-sm-4"p>>' });

Help me, please

If you need to customize markup for checkboxes, use checkboxes.selectAllRender and columnDefs.render options. Otherwise plugin will use default markup for cells containing checkboxes.

See Awesome Bootstrap Checkbox example for code and demonstration.

Oh dude, sorry. I did not see this detail.

Thanks for this amazing functionality