custom field function

custom field function

grezmangrezman Posts: 3Questions: 0Answers: 0
edited September 2009 in Plug-ins
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

Replies

  • allanallan Posts: 55,884Questions: 1Answers: 8,836 Site admin
    Hi grezman,

    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
  • grezmangrezman Posts: 3Questions: 0Answers: 0
    edited September 2009
    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.
  • allanallan Posts: 55,884Questions: 1Answers: 8,836 Site admin
    Hi grezman,

    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
  • grezmangrezman Posts: 3Questions: 0Answers: 0
    This is exactly what i was looking for... thank you very much for your instant help.
This discussion has been closed.