数据集多选列过滤器

编程入门 行业动态 更新时间:2024-10-25 14:29:09
本文介绍了数据集多选列过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在列过滤器中选择多个项目。以下示例允许您使用下拉列表对列进行过滤:

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

更多推荐

数据集多选列过滤器

本文发布于:2023-10-13 20:36:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1489012.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:过滤器   多选   数据

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!