Update one column of all rows in dataTables
Update one column of all rows in dataTables
Mauro26
Posts: 17Questions: 7Answers: 0
Hello everyone,
I have a discount column, i add an input for the % of the discount of the value and i want to refresh the whole column called "discount" when i put some % in the input... Is there anyway to do it, only in the client side?
I just need to calculate the new price, edit the data of that column (i don't know how) and redraw.
This is posible? i need al the help you can give me, i'm stuck here :(
Regards
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Try the following code
If that doesn't work, try
This clears the cache attached to this column and calls its associated render function.
The invalidate methods are probably the best way to go. However, it can depend upon the configuration of the table - we'd really need a link to the page to say for sure.
Allan
Hi guys i was investigating about the invalidate property, and searching i find some docs...
With this code is working:
but this is only working for the first page, i have a pagination of ten records the number the tr(11) doesn't take it so it only update the first page, How can i do for update all the rows?
Regards :)
See the second top FAQ :-)
Allan
I resolved with this:
function CalcDesc(){
var descuento = $('#desc').val();
and in the create of the dataTable i put this
and with that change always i do something in the datatable and exist a discount just add it to the table.
thanks allan