Add extra filter criteria from a separate form
Add extra filter criteria from a separate form
I have a vanilla DataTable based on a Doctrine entity Chemical
:
$(document).ready(function() {
$('#chemical).DataTable( {
"processing": true,
"serverSide": true,
"ajax": ""/CIR/web/app_dev.php/chemical/filter"
} );
} );
The entity is linked to many other entities that don't need to be displayed in the table. But they would be extremely useful for limiting the result-set. For example, a user may wish to see only those Chemicals
that have Supplies
which have Items
. For overhead reasons, I'd prefer not to include these other entities in a query unless I have to.
What I'd like to do is modify the request parameters that Datatables sends by including the field values from a separate form.
Can I set option ajax = function(){ }
? What is passed to the function? Is there a preferred way of modifying Datatables request parameters?