Home  >  Article  >  Web Front-end  >  About jQuery Datatable Multiple query conditions custom submission event example sharing

About jQuery Datatable Multiple query conditions custom submission event example sharing

小云云
小云云Original
2017-12-30 14:07:123026browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn