繁体   English   中英

bootstrap-table /如何在表配置中添加过滤器控件

[英]bootstrap-table / How to add filter-control in table configuration

我正在尝试对Bootstrap-table中的每一列进行过滤。

我见过很多使用HTML data-filter-control标记执行此操作的网站, 但我想在javascript方面进行操作 最好在表上配置属性。

这是一个HTML 数据过滤器控制标记示例:

  <thead>
        <tr>
            <th data-field="state" data-checkbox="true"></th>
            <th data-field="prenom" data-filter-control="input" data-sortable="true">Prénom</th>
            <th data-field="date" data-filter-control="select" data-sortable="true">Date</th>
            <th data-field="examen" data-filter-control="select" data-sortable="true">Examen</th>
            <th data-field="note" data-sortable="true">Note</th>
        </tr>
    </thead>

谢谢你们!

$(function () {
  $('#table').bootstrapTable({
    filterControl: true,
    disableUnusedSelectOptions: true,

    columns: [
      {
        field: "first_column",
        title: "First Column",
        filterControl: 'input',
        filterControlPlaceholder: "holder",
        filterStrictSearch: false
      },{
        field:  "second_column",
        title: "Second Column",
        filterControl: 'select',
        filterStrictSearch: false,
      },
    ]

  });
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM