Datatable Footer Callback: How to total an specific column?
Datatable Footer Callback: How to total an specific column?
beginner93
Posts: 2Questions: 1Answers: 0
I have 5 columns: Date Purchased, Item Name, Item Price, Item Quantity and Item Total.
And I only want the summation of Item Total.
Rigth now, its returning isNaN.
So how do I add a specific column only.
Thank You!
This discussion has been closed.
Answers
Are you using this example?
https://datatables.net/examples/advanced_init/footer_callback.html
Without seeing a running example with your specific data and footerCallback its hard to say what the problem is. Do you have something other than numbers in that column?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
yess po. I'm using that sample. And I think it is a client-side only. I dont know what should I change or where to add the sql that totals.
Without seeing your code or a test case as Kevin says, its impossible to say for sure, but if you are summing a calculated column you need to use
cells().render()
to get the calculated value, and then sum that.Allan