I am using jQuery DataTables, my JavaScript code is shown below:
$(document).ready(function() { var tbl = $('#table_tabl').DataTable({ responsive: true, "oLanguage": { "sUrl": "<?php echo RP_LANG ?>fr_FR.txt", }, "processing": true, "serverSide": true, ajax: "<?php echo RP_SSP ?>server_processing_reservTables.php", // I want to add a parmeter to it dynamically when a select element is selected "aoColumnDefs": [{ "aTargets": [3], "mData": 3, "mRender": function(data, type, full) { return '<div style="text-align:center;"><a href="RestaurantReservation/reserverTable/' + data + '" title="Réserver"><span class="mif-lock icon"></span></a></div>'; } }], "aLengthMenu": [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "Tout"] ] }); });
I want to filter this data table according to the selected value of the select element:
$("#select_id").on("change", function(){ // set the ajax option value of the dataTable here according to the select value });
How to set the ajax parameter of the dataTable parameter in the dataTable event of the on_change element based on the selected selected element?
jquery ajax datatables
pheromix
source share