Home > Article > Web Front-end > About jQuery Datatable Multiple query conditions custom submission event example sharing
This article mainly introduces the relevant information of jQuery Datatable multiple query conditions custom submission events. Friends in need can refer to it. I hope it can help everyone.
First write 2 inputs, representing the start time and end time respectively. Then write a button. Click the button to refresh the table. The code is as follows
Add the following settings to the datatable setting item as shown below. If it already exists Just add the following data options
ajax: { url: '/admin/index', type: 'POST', "data": function ( d ) { //添加额外的参数传给服务器 d.beginDate = $("#datetimepicker1").val(); d.endDate = $("#datetimepicker2").val(); } }, $("#searchsubmit").bind("click", function () { //按钮 点击事件触发table重新请求服务器 $("#tags-table").dataTable().fnDraw(false); });
The server can get the start time directly$_POST['beginDate']
Related recommendations:
jQuery Datatables header misalignment solution
##jquery DataTable--front and back dynamic paging
Jquery plug-in datatables attribute introduction and detailed explanation of creating paging and sorting examples
The above is the detailed content of About jQuery Datatable Multiple query conditions custom submission event example sharing. For more information, please follow other related articles on the PHP Chinese website!