ajax.data with updating value
ajax.data with updating value
matt_benett
Posts: 6Questions: 1Answers: 0
I have a selectbox, that I want to use in my serverside processing of each ajax request sent through.
I have the below:
$('#example').dataTable( {
"ajax": {
"url": "data.json",
"data": {
"myfilter": $('#otherfilter').children("option:selected").val()
}
}
} );
My issue is when the page loads the value is 1. And even if I change it after, the ajax request keeps sending 1, it never re-updates to on each request.
Any ideas please.
This discussion has been closed.
Replies
Hi @matt_benett ,
It's probably because it sets the value to that value when first called, and then it's not being updated. Try chaging it to be a function that returns the value, that way it will always get the current value.
Cheers,
Colin
champion, thank you