Datatable Footer Callback: How to total an specific column?
Datatable Footer Callback: How to total an specific column?
![beginner93](https://secure.gravatar.com/avatar/9509b873b191653caa79c13f6e22cad8/?default=https%3A%2F%2Fvanillicon.com%2F9509b873b191653caa79c13f6e22cad8_200.png&rating=g&size=120)
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