我正在使用DataTables jQuery插件,但我遇到了問題 獲取全局輸入搜索框將是一個選擇框。如何使用外部選擇框過濾數據表?
隨着sDOM選項lrtip
,過濾輸入不顯示,但是是 它可能顯示選擇框和獲取數據表基於選擇框的變化過濾?
JS:
$(document).ready(function() {
var table = $('#table_page').DataTable({
paging: true,
ordering: false,
info: true,
searching: true,
sDom: "lrtip" // default is lfrtip, where the f is the filter
});
});
HTML:
<table id="table_page" class="display cell-border" width="100%">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
</table>
你見過[單獨列搜索(選擇輸入)示例](https://datatables.net/examples/api/multi_filter_select.html)? –
是的,但我希望全局搜索不是單個列搜索。 – LeMoussel
看起來像你的答案在這裏: http://stackoverflow.com/questions/12199759/datatables-custom-filtering –