I am using datatable 1.10. I have already create a table, but I can't manage to do the multiple "shift select" on its rows.
According to the DataTables doc:
TableTools has four row selection modes of operation:
none - Default, where no user row selection options are available
single - A single row can be selected
multi - Multiple rows can be selected simply by clicking on the rows
os - Operating System like selection where you can use the shift and ctrl / cmd keys on your keyboard to add / remove rows from the selection.
So I create my table as follows:
$("#my-table-div").DataTable({
"retrieve": true,
"pagingType": "full_numbers",
"pageLength": 50,
"lengthMenu": [50, 100, 200],
"dom": '<lfi<t>p>',
"autoWidth": false,
"columns": columnsTable,
"tableTools": {
"sRowSelect": "os"
}
});
As you can see, I'm using "sRowSelect": "os", but it is certainly not working as I desire. I can't get the "shift select" to work.
Any ideas on what I'm missing or doing wrong?
Here is a live example, you need to add dataTables.select.min.js ressource to manage the select option. And your option : "columns": columnsTable is problematic.
$(document).ready(function() {
$('#example').DataTable( {
"retrieve": true,
"pagingType": "full_numbers",
"pageLength": 50,
"lengthMenu": [50, 100, 200],
"dom": '<lfi<t>p>',
"autoWidth": false,
//"columns": columnsTable, <-- options problem
"select": {
"style": "os"
}
} );
} );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With