I was wondering if there is a plugin (or native function) to provide the ability to perform numerical computations with table cels. For example multiply the value of one field and add the result to another field. Thank you
It sounds like you are looking for something which is spreadsheet like, rather than a table display which is what DataTables is. What you are looking for could be done with scripting, and would integrate well with KeyTable ( http://sprymedia.co.uk/article/KeyTable ) - but it depends on exactly what you are planning to do!
hi allan and thank you for you reply,
i think you are right,
what i need to do is very simple. I have a table with numerical values (integers and floats) and i want to display at the bottom row of the table the total sum of the columns or the result of numerical operations between columns. I have to do it at the client side (with datatables), in order to have available all these great features of datatables (sorting,hide n show columns etc ) while the results will be recomputed to provide the correct values.
Ah I see what you mean - in that case, my apologies - I misunderstood. I through you were looking to add two arbitrary fields together, rather than just summing columns into the footer. If you want to do a summation - then this is indeed possible. Have a look at this example: http://datatables.net/examples/advanced_init/footer_callback.html - this shows how calculations can be done in the footer.
Replies
It sounds like you are looking for something which is spreadsheet like, rather than a table display which is what DataTables is. What you are looking for could be done with scripting, and would integrate well with KeyTable ( http://sprymedia.co.uk/article/KeyTable ) - but it depends on exactly what you are planning to do!
Allan
i think you are right,
what i need to do is very simple. I have a table with numerical values (integers and floats) and i want to display at the bottom row of the table the total sum of the columns or the result of numerical operations between columns. I have to do it at the client side (with datatables), in order to have available all these great features of datatables (sorting,hide n show columns etc ) while the results will be recomputed to provide the correct values.
Ah I see what you mean - in that case, my apologies - I misunderstood. I through you were looking to add two arbitrary fields together, rather than just summing columns into the footer. If you want to do a summation - then this is indeed possible. Have a look at this example: http://datatables.net/examples/advanced_init/footer_callback.html - this shows how calculations can be done in the footer.
Regards,
Allan