I am trying to use the examples given but the only way I can get select to work is to use TableTools (which I want to move to buttons but having trouble there, but that will be another post).
If I take out the TableTools section then select doesn't work, and the buttons don't show either with or without TableTools.
sidenote: also, notice like 14 in the code below. I had to add a dummy value to my recordset, which I called myCheckbox. If I tried like the example "targets:0" I would get a tn\4 error for unknown parameter 0
var tblNeedRA = $('#tblNeedRA').DataTable( {
//jQueryUI: "true",
//dom: "Tfrtp",
lengthChange: false,
autowidth: "false",
ajax: "lib/getNeedRA.php",
select: {
selector: 'td:first-child',
style: 'multi'
},
columns: [
{ orderable: false,
className: 'select-checkbox',
data: "myCheckbox"
}
,{data: "CartonID"}
,{data: "RANumber"}
,{data: "OldRANumber"}
,{data: "OCNumber"}
,{data: "TrackingNumber"}
,{data: "ShipperName"}
,{data: "Qty"}
,{data: "LoadingDockReceiptDate"}
,{data: "AddedBy"}
],
order: [[ 1, 'asc' ]],
"buttons": [
{
text: 'Select All',
className: 'btn-success',
action: function ( e, dt, node, config ) {
alert( 'Button activated');
}
},
{
text: 'Deselect All',
className: 'btn-success',
action: function ( e, dt, node, config ) {
alert( 'Button activated');
}
},
{
text: 'Refresh',
className: 'btn-success',
action: function ( e, dt, node, config ) {
alert( 'Button activated');
}
}
]
} );
var tableTools = new $.fn.dataTable.TableTools( tblNeedRA, {
sRowSelect: "multi",
} );
$( tableTools.fnContainer() ).insertBefore( '#tblNeedRA' );