bootstrap-table / 如何在 table 配置中添加过滤器控件
bootstrap-table / How to add filter-control in table configuration
我正在尝试对 Bootstrap-table.
中的每列进行筛选
我看到很多网站使用 HTML data-filter-control 标签来做到这一点,但我想在 javascript 边 做;最好在 table 配置属性上。
这是一个 HTML data-filter-control 标签示例:
<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,
},
]
});
});
我正在尝试对 Bootstrap-table.
中的每列进行筛选我看到很多网站使用 HTML data-filter-control 标签来做到这一点,但我想在 javascript 边 做;最好在 table 配置属性上。
这是一个 HTML data-filter-control 标签示例:
<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,
},
]
});
});