I'm trying to make a Button which closes onClick all opened tr in my Datatable.
I'm opening the rows with the following command :
oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'newtr');
Is there a simply possibility to close all opened tr rows in my Datatable?
I think your trying to accomplish the same thing i was which is when i open a second row i want the previous row to close.
Meaning i would only be able to display one rows details at a time.
Notice I am declaring a
var previousTr
on document ready and checking it before opening any 2nd row. remembering of course to set it again once you've opened a new row.After having initialized your datatable, you can bind click event on all tr and close selected row using :
Please see here for further documentation about datatable API.