Adding a child row with identical formatting
Adding a child row with identical formatting
I'm trying to add additional data in a child row using identical structure to the parent row (columns, alignment, etc). In other words, I want the child row to appear seamlessly below its parent with columns in alignment. Thanks to @bindrid, whose posted bin I hijacked for my example.
For the example, let's say that it's showing multiple roles for a single person (even though I've set it to be the same information as the parent). In my program the data will be different and have a variable number of rows using a different but related data source. To mimic this, my "format" function uses the same data but matched to the parent's row.
The returned result for the child is a new table, appearing under the parent. Is there a way to instead inject a row into the existing table or fully mimic the parent table's structure? I haven't seen this in any of the examples here (or those I found elsewhere). In the example, you can see how misaligned the columns are, because some fields are not included (in this case, the button and name). My program uses Bootstrap so I don't want to simply force fixed column widths for all columns. Thanks for any help or direction.
Example here: http://live.datatables.net/nugudefa/1/edit
This question has an accepted answers - jump to answer
Answers
See Allan's answer in this thread. Basically you need to use this:
Like this example:
http://live.datatables.net/gupazase/1/edit
Kevin
You are my hero. Thank you. For anyone whose search brings them to this thread, here's a version that works. (It always drives me nuts when someone says "Thanks, it worked!" and I can't see it )
http://live.datatables.net/nugudefa/2/edit
Me too!!
Glad to be of help.
Kevin