Auto Calculating of Column Cells
Auto Calculating of Column Cells

Hi All,
I'm sure this has been asked before, but with this code, I'm trying to figure out the best way to auto-add the values from the cells in the "Points" view, shown here:
http://live.datatables.net/yohuluco/1/edit
With the buttons, there is a points vs. a time view and I'd like to calculate the total of however many point "columns" there are. It is at 3-4 now, and will grow to 10-11. I'm looking for a clean way to do that, ideally.
Thanks again for all the help here.
Ed
This question has an accepted answers - jump to answer
Answers
Are you looking for something like this example?
https://datatables.net/examples/advanced_init/footer_callback.html
Kevin
The "total" text shown in red in my example - rather than having that "total" hardcoded into the HTML/JSON data, I'd like to replace that with the numeric total shown across the row, per person (in this case, "prologue + stage1 + stage2 + stage3", etc.).
Ed
I see. You can use
columns render
to build your total column. See this updated example:http://live.datatables.net/yohuluco/2/edit
Kevin
Thanks Kevin, this is perfect.