【问题标题】:Custom filter in datatable with search button in jquery使用jquery中的搜索按钮在数据表中自定义过滤器
【发布时间】:2016-09-27 15:14:01
【问题描述】:

我正在使用数据表插件,我想添加自定义搜索按钮 (Go) 来过滤由数据表填充的网格。当用户单击 go 按钮时,应该过滤选择药物和组织结果

 $(document).ready(function() {
    $('#example').dataTable();
} );

【问题讨论】:

    标签: jquery datatable


    【解决方案1】:

    您似乎要添加多个自定义下拉过滤器。

    你可以这样做。

    //Call datatable
    var table = table =  $('#tableId').DataTable({});
    
    //Call on change event of dropdown and same thing can be done on Go button click
    $('#drugDropdownId').on('change', function () {
        //Column number can be changed as per your need
        table.columns(2).search(this.value).draw();
    });
    

    请查看DataTable Search

    仅供参考,请确保您使用正确且受支持的数据表版本方法。

    【讨论】:

      猜你喜欢
      • 2016-05-08
      • 2020-06-11
      • 1970-01-01
      • 1970-01-01
      • 2018-07-01
      • 2018-01-21
      • 1970-01-01
      • 1970-01-01
      • 2020-12-13
      相关资源
      最近更新 更多