我正在使用jQuery DataTables,我的JavaScript代码如下所示:
$(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 '
';}
}],
"aLengthMenu": [
[10, 25, 50, 100, -1],
[10, 25, 50, 100, "Tout"]
]
});
});
我想根据select元素的选定值过滤此dataTable:
$("#select_id").on("change", function(){
// set the ajax option value of the dataTable here according to the select's value
});
如何设置ajax的选项的值dataTable中on_change的事件select基础上,选择的所选项目元素?