Child rows (show extra / detailed information)
Child rows (show extra / detailed information)
islamelshobokshy
Posts: 99Questions: 20Answers: 1
I am following this tutorial : https://datatables.net/examples/api/row_details.html
I want when I click the + button to have other <tr> and <td>s to align in the same exact placements as the main column. Is there a way to align them properly like so so they would be attached to the parent's columns?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @islamelshobokshy ,
This thread here should help, or this SO thread here.
Cheers,
Colin
I followed the tutorials there, for each child tr I get an error
DataTables warning: Non-table node initialisation (TR). For more information about this error, please see http://datatables.net/tn/2
when I did thisreturn $('<tr>...</tr><tr>...</tr>').toArray();
After clicking OK multiple times on the alerts I get, the table works.
Found the problem : It's because
row.child()
contains multipletr
s thus doing a.DataTable()
on all of them makes him angry. I had to do it this way :This is solved, thanks!
It's not solved, I'm sorry, as I get an
Uncaught TypeError: row.child(...).forEach is not a function
error in my console, so even tho it works it's not a clean way. Do you have any idea how to do it cleanly?Yep, there would only be a single child for each row, so
forEach
wouldn't mean anything.This thread here should help, it shows how to create DataTables in child rows.
I did using the following, no idea why this shows no errors but as long as it works