111
rated 0 times
[
114]
[
3]
/ answers: 1 / hits: 6080
/ 4 Years ago, thu, june 11, 2020, 12:00:00
so I am working with dataTables and I am having trouble on showing the checkboxes on my tables. So I have this code:
<table id=employeeList class=table table-sm table-bordered table-hover cellspacing=0 width=200%>
<thead class=blue lighten-2>
<tr>
<th>RTO</th>
<th>Name</th>
<th>Address</th>
<th>RTO Score</th>
<th>Production Machine</th>
<th>Transportation Availability</th>
<th>Department/Team</th>
<th>Return to Office Date</th>
<th>Willingness</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>Sample</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td></td>
<td>Sample2</td>
<td>1</td>
<td>123</td>
<td>asd</td>
<td>asd</td>
<td>asd</td>
<td>asd</td>
<td>asd</td>
</tr>
</tbody>
And I have the script which enable the dataTable to have both vertical and horizontal scrolling and supposedly the checkboxes on the first-child of the table.
<script>
$(document).ready(function () {
$('#employeeList').dataTable({
scrollX: true,
scrollY: 350,
columnDefs: [{
orderable: false,
className: 'select-checkbox',
targets: 0
}],
select: {
style: 'os',
selector: 'td:first-child'
}
});
$('.dataTables_length').addClass('bs-select');
});
Is there something I missed? Thank you very much for the help.
More From » html