How do I calculate column totals when pagination is enabled?
How do I calculate column totals when pagination is enabled?
twentyfive
Posts: 3Questions: 0Answers: 0
Hello,
My table is similar to this one: http://datatables.net/blog/Creating_beautiful_and_functional_tables_with_DataTables
where the last row in my table contains column totals. The difference in my case, however is that the totals are not static. Some cells allow the user to change cell's value via an input field, which in turn changes the total. I have a callback to handle this event, so that whenever an input's value is changed, the total is recalculated accordingly. The issue I'm having is that when using pagination, it only calculates the total of the rows that are displayed on screen (e.g. the ones on the current page), as opposed to all of the rows of the table. So I guess my question is, when using pagination, how can I retrieve all of the rows in the table?
My table is similar to this one: http://datatables.net/blog/Creating_beautiful_and_functional_tables_with_DataTables
where the last row in my table contains column totals. The difference in my case, however is that the totals are not static. Some cells allow the user to change cell's value via an input field, which in turn changes the total. I have a callback to handle this event, so that whenever an input's value is changed, the total is recalculated accordingly. The issue I'm having is that when using pagination, it only calculates the total of the rows that are displayed on screen (e.g. the ones on the current page), as opposed to all of the rows of the table. So I guess my question is, when using pagination, how can I retrieve all of the rows in the table?
This discussion has been closed.
Replies
Allan