jQuery DataTables: Expand only one row at a time and other row should be collapsed?
jQuery DataTables: Expand only one row at a time and other row should be collapsed?
Raj_Banothe
Posts: 3Questions: 0Answers: 0
I have a different solution. It Working fine with responsive table.
var clicks = 0;
$('#documents').on('click', 'tr td.dtr-control', function (e) {
e.preventDefault();
if(clicks == 3){
clicks = 1;
}
clicks += 1;
if(clicks <= 2){
table.rows('.parent').nodes().to$().find('td:first-child').not(this).trigger('click');
// OR use below code
//$('#documents').find('.parent td.dtr-control').not(this).trigger('click');
}
});
Replies
Nice one - thanks for posting this.
Allan