用于 Excel 的 jQuery 插件,如过滤器功能

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3971311/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 16:26:45  来源:igfitidea点击:

jQuery plugin for Excel like filter functionality

jqueryjquery-plugins

提问by igorti

I need to implement a feature that would allow users to filter table data in Excel like style, i.e. dropdown menu in column headers with list of checkboxes or checkboxes grouped hierarchicaly. For instance for date column I would like to show treeview with year as root node, then month when year node expands and day on the last level. All that with checkboxes so that users can select several values.

我需要实现一个功能,允许用户像样式一样过滤 Excel 中的表格数据,即列标题中的下拉菜单,其中包含分层分组的复选框或复选框列表。例如,对于日期列,我想显示以年份为根节点的树视图,然后是年份节点扩展的月份和最后一级的日期。所有这些都带有复选框,以便用户可以选择多个值。

I've looked around a bit and all existing plugins do pretty basic filtering - ascending/descending or freetext search. I have tried to extend 'dropdownchecklist' plugin but came to a point when it seemed easier to write new plugin from scratch.

我环顾四周,所有现有插件都进行了非常基本的过滤 - 升序/降序或自由文本搜索。我曾尝试扩展“dropdownchecklist”插件,但到了从头开始编写新插件似乎更容易的地步。

Any tips or ideas are appriciated!

任何提示或想法都是appriciated!

回答by Moin Zaman

The closest I can find is jqGrid with an integrated search toolbar which sort of acts like a filter.

我能找到的最接近的是带有集成搜索工具栏的 jqGrid,它有点像过滤器。

Have a look here: http://trirand.com/blog/jqgrid/jqgrid.html

看看这里:http: //trirand.com/blog/jqgrid/jqgrid.html

You'll need to expand 'New in Version 3.5' under items and then click on 'Integrated Search Toolbar' to see the demo.

您需要在 items 下展开“New in Version 3.5”,然后单击“Integrated Search Toolbar”以查看演示。

There is a non-jQuery library called ExtJS that has many components, grids being one of their main ones, that definitely does it like Excel: http://dev.sencha.com/deploy/dev/examples/grid-filtering/grid-filter-local.html

有一个名为 ExtJS 的非 jQuery 库,它有许多组件,网格是它们的主要组件之一,它确实像 Excel 一样:http: //dev.sencha.com/deploy/dev/examples/grid-filtering/grid -filter-local.html

If the Grid is a major part of your application and you need this excel like functionality maybe consider using ExtJS. You can use jQuery alongside it too, although it does have some core features that do similar things to jQuery.

如果网格是您应用程序的主要部分,并且您需要这种类似 excel 的功能,可以考虑使用 ExtJS。您也可以将 jQuery 与它一起使用,尽管它确实具有一些与 jQuery 类似的核心功能。