还没有OPTGROUP吗?
我在 3 年前的 dojo trac 中读到一个关于 dojo 组合框需要实现选项组的担忧。我使用的是 1.3.2 版本,但我的组合失败了。这么长时间以来,选项组仍然不受支持吗?
谢谢。
I read in the dojo trac from 3 years ago a concern that dojo combobox needs to implement option groups. I am using version 1.3.2 and my combo is failing. Are the option groups still not supported after all this time?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
似乎没有办法在组合框小部件中使用 optgroups。那张票已被关闭,并且没有新的票被打开。也没有一种真正的方法可以在 dojo.data 中一致地表示数据。不过,可以通过编辑 dijit 创建自定义解决方案,只需以对您的应用程序有意义的方式管理 optgroup 即可。
There doesn't seem to be a way to use optgroups in the combobox widget. That ticket was closed and no new one was ever opened. There is also not really a way the data could be represented consistently in dojo.data either. It would be possible to create a custom solution to this by editing the dijit though, just manage the optgroups in the way that makes sense for your application.
如果您愿意使用类似的选择小部件,您可以考虑使用
dijit-select-optgroup
。dijit-select-optgroup
基本上是dijit/form/Select
的自定义版本,其中包括选项分组(类似于 html更多信息:
https://github.com/gibbok/dijit-select-optgroup
现场演示:
https://gibbok.github.io/dijit-select-optgroup
免责声明:我拥有这个仓库:)。
You could consider using
dijit-select-optgroup
if you are willing to use a Select alike widget.dijit-select-optgroup
is basically a custom version ofdijit/form/Select
which includes grouping of options (similar to html<select>
element with<optgroup>
).More info:
https://github.com/gibbok/dijit-select-optgroup
Live demo:
https://gibbok.github.io/dijit-select-optgroup
Disclaim: I own this repo :).