Adding a TR to the bottom of each group of rows (as a "footer" for each group)

Adding a TR to the bottom of each group of rows (as a "footer" for each group)

jLinuxjLinux Posts: 981Questions: 73Answers: 75
edited October 2016 in Free community support

@allan,

I'm working on a DT instance that will use DataTables ability to group rows by a specific column (As found in this example). Only, instead of just adding a tr above the grouped rows, I also need to add another tr to the bottom of the grouped rows (to show the orders sum total, and a few other things).

I created a DataTables JSBin instance to help get things going. You can see how the rows are grouped by the company name, and in an effort to keep the grouped rows together (regardless of what column the table is ordered by), I set the columns.orderData value for each column.

So, is there an easy way to add another tr after the groups rows, but before the next groups tr?

Thanks!

-J

Update

Looks like I was able to get this sorted out, checkout the new code in this JSBin instance. I'm not positive that that's the best way to go about doing it, so if there's a better way, lmk!

P.S.

I'm thinking about making a DT plugin that will make this much easier... think itll be useful to others?

This discussion has been closed.