Subtotals in a new row
Subtotals in a new row
ursasmar
Posts: 6Questions: 0Answers: 0
I have the following test case up, http://live.datatables.net/usabel
I have added a grouping type function on the Engine column, and a total of Version that I add to the footer of the table. What I would Like to add is a new row, before the group change, that contains the subtotal of the group. The numbers I would like summed up are the version numbers.
I have added a grouping type function on the Engine column, and a total of Version that I add to the footer of the table. What I would Like to add is a new row, before the group change, that contains the subtotal of the group. The numbers I would like summed up are the version numbers.
This discussion has been closed.
Replies
The function i am talking about is fnGetData . You might be able to iterate over your rows and then try to insert where you have detected a change.
Would also love to get some ideas about doing multiple groupings (ie on 2 columns) if you have anything. Thanks!!
As was requested above by jasonalec, would you be willing to share your solution with the community? I believe that subtotals is a very common requirement when grouping data and if you have something that can ease the pain of "re-inventing the wheel" that would be fantastic.
Another question for you, did you ever see the row grouping plugin for datatables (found here, http://jquery-datatables-row-grouping.googlecode.com/svn/trunk/collapsibleGroups.html)? It allows you expand/collapse the grouped rows. Unfortunately, it didn't allow for subtotals of columns (although it could provide a subtotal of the number of rows per group). It would be even more fantastic if you could somehow put your subtotaling code into the row grouping plugin and "kill several birds with one stone"