Responsive: Don't Expand/Collaps with click on row
Responsive: Don't Expand/Collaps with click on row
Hi, I use a DataTable with these settings:
$(document).ready(function () {
$('#mydatatable').DataTable({
responsive: true,
paging: false,
autoWidth: false,
info: false,
dom: 'frtipB',
buttons: [
{ extend: 'copy', text: 'Kopieren' },
{ extend: 'excel', text: 'Excel' },
{ extend: 'csvHtml5', text: 'CSV', fieldBoundary: '', fieldSeparator: ';'},
{ extend: 'pdf', text: 'PDF' },
{ extend: 'print', text: 'Drucken' }
]
});
});
Now each row has a "+"-Button where I can expand/collapse it as soon as a column is hidden.
Unfortunately I can also expand/collapse a row when I click on it somethere else.
Is it possible to only expand/collapse it via the button? My Table has other buttons and whenerve I press them the row expands which is not was I want.
Thanks in Advance!
Answers
Looks like you are initializing responsive with just
responsive: true
which will create a responsive click event in the first cell of each row, like this example. Clicking anywhere else in the row does not expand or collapse the hidden columns.We will need to see the problem to help debug. Please post a link to your page or a test case replicating the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin