how to read data from table after being built?

how to read data from table after being built?

woodstownwoodstown Posts: 2Questions: 0Answers: 0
edited October 2010 in General
My Table should look something like that:

.-------------------------------------.
| Basket |
+----+-----------------------+-------+
| Id | Name .............. | Price |
+----+----------------------+-------+
| 1 | Dummy product 1 | 24.4 |
| 2 | Dummy product 2 | 21.2 |
| 3 | Dummy product 3 | 12.3 |
+----+----------------------+-------+
| | Total ................. | 57.9 |
'----+------------------------+-------'

I want to calculate the "Total" in the last row depending on what the table is currently displaying.
E.g. the user search in the global search field for "Dummy product 2" -
The total should be 21,2 because only the second row would be displayed.

Therefore i need to go through the currently displayed data in the table and read the data, calculate and put it in the last row.
i need to go through that function every time the table changes. e.g. search, next page, rows per page are changed etc.

Would appreciate your help very much! Thank you.

Replies

  • mstrandmstrand Posts: 24Questions: 0Answers: 0
    I've used the footer callback example to add column totals.
    The example can be seen here:

    http://www.datatables.net/examples/advanced_init/footer_callback.html
This discussion has been closed.