How can I use a form control in column 3 to change the value of column 5?
How can I use a form control in column 3 to change the value of column 5?
I have a fully functional datatable that currently shows a product, the minimum price, a range form control, target price, and sale price.
Can be seen here: https://jsfiddle.net/mgargiullo/rvob1Lcu/
The range form control has the min and max set with the starting value the same as the "sale_price" field (column 5). I'm trying to update the sale_price in column 5 when the range form control in column 3 changes.
I'm reasonably sure there's a way to do this, but I've gone down so many paths that I'm starting to confuse myself.
This question has an accepted answers - jump to answer
Answers
Use a delegated event as shown in this example. I updated your test case to show this:
https://jsfiddle.net/x0L9y4o8/
It uses
row().data()
to get and set the row data. Usedraw()
withfalse
to stay on the same page.Kevin
You, sir, are a rock star!
Thank you!