Render price from unit_price * quantity on each row while using inline editing
Render price from unit_price * quantity on each row while using inline editing
sven_oliver_simpson
Posts: 3Questions: 2Answers: 0
in Editor
Hi,
my mysql database has 2 columns: quantity and unit_price. Using inline editing it can be directly updated.
The DataTable should have a third column showing the price for each row calculated from quantity*unit_price and it should be updated whenever I change quantity or unit_price using inline editing.
How is the best way to implement this?
Thanks
SOS
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The best way typically is to use
columns.render
. Set thecolumns.data
option for the column to null and then use a function for the renderer. For example:Allan
Works. Thanks