Drawcallback receive parameter external
Drawcallback receive parameter external

Hi,
I have one table and this table need to be redraw after one event in external input of DataTable, for exemple one input radio.
When the user checked one radio option, is called the drawcallback function.
My logica is use the ajax in drawcallback, but I readed(and tried), but that is not possible.
My doubt is: How to send by parameter the input radio value in drawcallback function and to make request in server side?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @fael_christofano ,
It might be better to say what you're trying to do, because as you said, the
drawCallback
is unlikely to be right place.If the buttons affect the drawing of the table, or the data that you want from the server, the best bet would be to call
ajax.reload()
in the click event for the radio button. You could send the value of the radio button, or some other logic based on the selection, to the server inajax.data
. This would force a reload based on the selection.Hope that helps,
Cheers,
Colin
Hi @fael_christofano ,
As I said, you can use
ajax.data
for that. Set it in the main ajax declaration in the table initialisation.Cheers,
Colin
I Edited my question, did you see?
If you look at the examples on the page
ajax.data
, you'll see they're setting a value that goes into the JSON, you're not doing that.Your line 7 should be something like:
You would then access
checkValue
on the server.Perfect Colin, but I modified this code, stayed like this