使用 HTML + JavaScript 实现多列组合框
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4221439/
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
Implement multi column combo box using HTML + JavaScript
提问by Cheok Yan Cheng
I am looking a multi columns combo box by using HTML + JavaScript only. Is there any example or library available? As I came across some solution, they are in ASP.NET, but not pure HTML + JavaScript.
我正在寻找一个多列组合框,只使用 HTML + JavaScript。有没有可用的示例或库?当我遇到一些解决方案时,它们在 ASP.NET 中,但不是纯 HTML + JavaScript。
Here is an example but it is implemented using Java Swing.
这是一个示例,但它是使用 Java Swing 实现的。
采纳答案by Surreal Dreams
If jQuery is an option, here's a plugin that looks like it can deliver this:
如果 jQuery 是一个选项,这里有一个插件,它看起来可以提供这个:
回答by SuperDuck
Flexboxis probably the best one I have ever used with jQuery, with paging and JSON support :
Flexbox可能是我用过的最好的 jQuery 了,支持分页和 JSON:
It's a real combo box, as it displays the results by typing. It can be easily restyled through the CSS.
这是一个真正的组合框,因为它通过键入显示结果。它可以很容易地通过 CSS 重新设计。
Eg. to modify the rows :
例如。修改行:
.ffb .content .row {
border-bottom: 1px solid #828790;
clear: both;
color: #000000;
height: 20px;
}
border-bottom
may be removed to get rid of lines between rows.
border-bottom
可以删除以摆脱行之间的行。
回答by Juan Mendes
http://dev.sencha.com/deploy/dev/examples/form/combos.htmlShows ExtJS's combo box. Their combo box can be customized with template to be used for rendering each entry. All you'd need to do is to specify a template that contains a few spans with a set width.
http://dev.sencha.com/deploy/dev/examples/form/combos.html显示 ExtJS 的组合框。他们的组合框可以使用模板进行自定义,以用于呈现每个条目。您需要做的就是指定一个模板,其中包含几个具有设置宽度的跨度。
If you're willing to use ExtJS (not free), write it in here, and I'll show you an example
如果你愿意使用 ExtJS(不是免费的),把它写在这里,我会给你一个例子