select style 'api' not working
select style 'api' not working
Francesco Di Sciascio
Posts: 8Questions: 3Answers: 0
Hi everyone,
I'm facing a trouble with DataTables select plugin; in particular, it seems that the 'api' style selection already allows user to select rows of table, but I expected that it doesn't, as read in api reference here.
I would set the style in the initComplete() callback, but it doesn't work too: rows are always selectable
Here's the code of table initialization:
prestDaSelezionareTable = $('#prestDaSelezionareTable').DataTable({
ajax: {
url: url,
dataSrc: ""
},
columns: [
{"data": "codice"},
{"data": "prestazione"},
{"data": "statoPrestazione"},
{"data": "giorno"},
{"data": "sconto"}
],
columnDefs: [
{
targets: 'thHidden',
visible: false
},
{
targets: COLONNA_GIORNO,
render: $.fn.dataTable.render.moment('MMM D, YYYY HH:mm:ss A', 'DD/MM/YYYY')
}],
language: {
"url": "//cdn.datatables.net/plug-ins/1.11.3/i18n/it_it.json"
},
select: {
style: 'api',
info: false
},
});
Thanks for the suggestions.
Regards
This question has an accepted answers - jump to answer
Answers
Your code snippet works here:
http://live.datatables.net/feceyula/1/edit
Maybe you have a click event that is selecting the rows. Please update my test case or post a link to your page so we can take a look to help debug.
Kevin
You are right, I've found something in my code that changes the select style.
Thanks for your help!