我想在列过滤器中选择多个项目。以下示例允许您使用下拉列表对列进行过滤:
I want to Select multiple items in a column filter. The following example allows you to filter on columns using dropdowns:
datatables/release-datatables/examples/api/multi_filter_select.html
但是,我会喜欢能够在列过滤器中选择多个项目,可能在下拉列表中的每个项目旁边都有一个复选框。例如在这个例子中,我会将'A'和'C'分别列为'CSS等级',这样才能在表格中显示这些成绩。
However, I would like to be able to select multiple items in the column filter, possibly with a checkbox beside each item in the dropdown. e.g. in the example, I would Tick 'A' and 'C' for 'CSS grade' so that only these grades are displayed in the table.
选择列过滤器使用DataTables插件或其他?
How can I get multi select column filters either using the DataTables plugin or otherwise?
推荐答案您可以使用选择列表,复选框和其他任何方式构建自己的过滤器div使用 fnFilter 从服务器请求过滤的数据。例如:
You could build your own filter div with selectlists,checkboxes and whatever and use fnFilter to request filtered data from the server. For example:
$("#mycheckbox").click(function () { var dt = $('#mytable').dataTable({ "bRetrieve": true }); dt.fnFilter($("#mycheckbox").is(':checked'), 1); });帖子:
sSearch_1 : true/false更多推荐
数据集多选列过滤器
发布评论