How can I keep child rows opened after the Ajax reload
How can I keep child rows opened after the Ajax reload
Alex67000
Posts: 39Questions: 6Answers: 0
I'm using an Ajax source to generate the table. This one is refreshed every 5000 ms and when a child row is opened it's then closed by the table's redraw. How can I keep these ones opened?
http://datatables.net/examples/ajax/objects.html
http://datatables.net/examples/api/row_details.html
https://datatables.net/reference/api/ajax.reload()
This discussion has been closed.
Answers
I succeeded to keep child rows opened. But now I'm stuck to close them: I cannot close the opened row child by clicking on the same td.details-control (which open and should close the row child) but the opened row child is closed after that I click on another td.details-control (so after that I open another row child).
} );
The problem is here: (I shall work on the condition but tried 10 000 things, and still stuck)
if (tr !== null && tr !== undefined && row !== null && tr !== undefined)
{
}
Because the row.child.hide(); I am stuck in the open this row condition and this code is there to close the previous row child and open the new one (but if I stay on the same row and I click on the button, it's not closed)
Twice tr !== undefined in the condition above.
Yeah.