Using two functions in data to pass via ajax
Using two functions in data to pass via ajax
mahmoodrm
Posts: 4Questions: 2Answers: 0
hello friends;
I need to define two functions in the datatables to pass two data through ajax as shown below but the problem is that this two functions are not working together but together not. when I uncomment line 12, the second function will work properly, and when I commenting the second function, the first one is working fine. would you please let me know what is wrong with my code below:
$(document).ready(function () {
var dataTable = $("#emp_list").DataTable({
searching: true,
processing: true,
serverSide: true,
paging: true,
order: [],
ajax: {
url: "fetch.php",
type: "POST",
"data":
//{selectdep: function() { return $('#selectdep').val()}},
function ( d ) {
d.check1 = check1;
d.check2 = check2;
d.check3 = check3;}, },
});
$('#selectdep').on('change', function() { dataTable.ajax.reload();})
});
This question has an accepted answers - jump to answer
Answers
Maybe you need something like this:
Kevin
Thank you so much Kevin @kthorngren ! it's now working fine