选择具有 100 万个选项的下拉元素,咳咳...也依赖
假设我们有三个依赖的选择下拉列表(选择父项通过数据库查询异步填充子项):
DD1:[这个世界的人]
DD2:[发丝]
DD3:[角蛋白分子]
好的,我们的选项列表不会像这里的名称所暗示的那么大,但每个下拉菜单将容纳大约 1 个万个选项。有一天,我们尝试将大约 20,000 个选项项(通过 ajax)加载到子下拉列表中,但 UI 冻结并且出现问题。
有什么策略吗?
(我们使用 Spring MVC/JSTL + Tiles/DB2/EXTJS)。
Say we have three dependent select dropdowns (selecting parent asynchronously populates the child via a database query):
DD1: [People of this world]
DD2: [Hair Strands]
DD3: [Keratin Molecules]
Ok, our options' lists won't be as large as what the names here imply, but each dropdown is going to house about 1 million option items. The other day we tried loading about 20,000 options items (via ajax) into a child dropdown, and the UI froze and things went wrong.
Any strategies?
(We're on Spring MVC/JSTL + Tiles/DB2/EXTJS).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要找到更好的方法来做到这一点。不是因为这在技术上很困难(确实如此),而是因为如果用户必须滚动包含一百万个项目的下拉列表,他们就会找到你并将你打死。
例如,世界上的人们可以按字母顺序(根据前五个字符分开的 60 亿人,平均每组有 500 个项目)或按地理区域进行划分。
我不知道角蛋白分子,但根据我对高中化学的记忆,我很确定它充满了层次结构。
You need to find a better way of doing this. Not because it's technically hard (it is) but because your users will track you down and beat you to death if they have to scroll through a drop-down list containig a million items.
As examples, people in the world can be separated alphabetically (six billion people separated based on the first five characters will give you 500 items on average per group) or by geographical region.
Keratin molecules I don't know about but I'mm pretty sure from what I remember of my high school chemistry that it was full of hierarchies.
嗯,对事物进行分层组织的目的不是为了使每个级别的选择数量易于管理吗?那么,一种解决方案不是有更深的层次结构吗?我怀疑您可能仍然对为少数选项设想的技术存在问题。
Umm, isn't the point of hierarchical organisation of stuff to make the number of choices at each level manageable ? So isn't one solution a deeper hierarchy ? I suspect that you may still have problems with technology conceived for handfuls of options.