DataTable multi select - overriding with CNTRL or SHIFT
DataTable multi select - overriding with CNTRL or SHIFT
RNA_Polymerase
Posts: 2Questions: 0Answers: 0
I need to be able to configure TableTools to do multi selects with more standard GUI defaults ("Hold CNTRL to select Multiple"). The most important of these two is the CNTRL method. Essentially it would function like this: once "sRowSelect" is set at "single", holding the CNTRL button would move you into "mutli" select mode. Release the CNTRL button would put you back into "single" select mode. Any one found a way to do this or at least perhaps a button to toggle between Single and Multi select?
Also, as an additional bonus, it would be great to have the other GUI default ("Hold SHIFT to Select a range"). But that one is not pressing for my needs right now.
Also, as an additional bonus, it would be great to have the other GUI default ("Hold SHIFT to Select a range"). But that one is not pressing for my needs right now.
This discussion has been closed.
Replies
[code]
$('#invoiceList').dataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sRowSelect": "single",
"aButtons": [
{
"sExtends": "text",
"sButtonText": "Multi-Select",
"fnClick": function ( nButton, oConfig, oFlash ) {
var selectSetting = this.s;
if (selectSetting.select.type == "single" || selectSetting.select.type == "none") {
selectSetting.select.type = "multi";
nButton.innerText = "Single-Select";
}
else if (selectSetting.select.type == "multi") {
selectSetting.select.type = "single";
nButton.innerText = "Multi-Select";
}
}
}
, "select_all"
, "select_none"
]
},
});
[/code]
Note: I also added the "Select all" and "Deselect all" buttons here because they fit for my purposes.
There is no built in way to do a shift select in TableTools - that would require a change to the core code. I think it would be a good one to make (adding another selection type basically that will account for shift, ctrl clicks) but its not something it does yet. Added to the TableTools road map, but that is likely a good 6 months off with all the other work needed on DataTables at the moment!
Allan