ajax.data option does not work when I'm using a function that returns an object.
ajax.data option does not work when I'm using a function that returns an object.

Hello, according do documentation (https://datatables.net/reference/option/ajax.data), this code should work when initializing datatable
ajax: {
url: myURL,
type: "POST",
data: {
function(d) {
return $.extend({}, d, {
'fechaInicio': $('#rangoFechas').data('daterangepicker').startDate,
'fechaTermino': $('#rangoFechas').data('daterangepicker').endDate
});
}
}
},
When the datatable is created and calls the URL, data passed is an object, and not both parameters individually (fechaInicio, fechaTermino).
What is wrong here?
Regards
Jaime
This discussion has been closed.
Answers
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin