简体   繁体   English

Javascript-复选框网格?

[英]Javascript - Grid of Checkboxes?

I am about to start a task where I will have a grid of checkboxes which will allow users to select all of the checkboxes, some of them or none of them. 我将开始一个任务,其中将有一个复选框网格,该网格将允许用户选择所有复选框,选择其中的某些复选框,或不选择其中的任何复选框。 I will also add a few conditionals where you can select a checkbox if you have selected the one above it directly and deselect them if the checkbox above has been selected. 我还将添加一些条件,如果您直接选择了上面的复选框,则可以在其中选择一个复选框;如果已经选择了上面的复选框,则可以取消选择它们。

Before I write this I was wondering if there is something that is already out there than can do this or something similar? 在写这篇文章之前,我想知道是否已经有什么东西可以做或者类似的事情? Or at the very least something I can build on. 或者至少我可以建立一些东西。 I have already bing'ed and Google'd - but nothing has come up for me. 我已经结识了Google,但我却一无所获。

I would also appreciate implementation advice as this I don't want this to be a messy job and I can already imagine myself getting into a mess! 我也希望得到实施建议,因为我不希望这是一件麻烦的事,而且我已经可以想象自己会陷入困境!

I would really love it if there was something out there for JQuery as I already make use of this. 如果我已经使用了JQuery,那么我真的很喜欢它。

Thanks all 谢谢大家

You're better off rolling your own. 你最好自己动手。 Sounds like a pretty specific set of requirements, and I doubt you'll find anything that does this easily, and even if you did, it would take more time to figure out how the API works and fit it to your needs than to just write the thing yourself. 听起来像是一组非常具体的要求,而且我怀疑您会发现容易做到这一点的任何东西,即使您做到了,要弄清楚API的工作方式并使其符合您的需求也要花费更多的时间,而不仅仅是编写你自己的事情。

我找到了这个jquery插件 ,稍加调整就可以完成您想要的...

I know you asked about jQuery, however ExtJS offers a grid with checkboxes. 我知道您问过有关jQuery的问题,但是ExtJS提供了一个带有复选框的网格。 You create a grid using a CheckboxSelectionModel. 您使用CheckboxSelectionModel创建一个网格。

Try using JSLightGrid . 尝试使用JSLightGrid Though it's not JQuery rather pure javascript but is pretty good for column templates, performance, responsiveness and very light weight 尽管它不是JQuery而是纯JavaScript,但对于列模板,性能,响应性和非常轻量来说非常好

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM