简体   繁体   English

适用于Spring Roo / Web MVC项目的漂亮的javascript多选小部件?

[英]Pretty javascript multiselect widget suitable for Spring Roo / Web MVC project?

I'm looking for a Javascript multiselect to use on my Spring Roo / Web MVC project, and worried that I could spend a while adding a widget from a library that then breaks other stuff. 我正在寻找一个Javascript多选用于我的Spring Roo / Web MVC项目,并担心我可能会花一些时间从库中添加一个小部件然后打破其他东西。 Requirements: 要求:

  1. Prettier and more functional than the standard Dojo multiselect which Roo uses when scaffolding ManyToMany relationships, ie the user shouldn't have to hold down ctrl or shift to select more than one item. 比标准的Dojo multiselect更漂亮,功能更多,Roo在搭建ManyToMany关系时使用,即用户不必按住ctrl或shift来选择多个项目。
  2. Plays nicely with the javascript that is already used in the Roo scaffolding - so I guess that means first prize is something built on top of Dojo, although I'm not completely against adding other libraries. 使用已经在Roo脚手架中使用的javascript很好地播放 - 所以我想这意味着一等奖是建立在Dojo之上的东西,尽管我并不完全反对添加其他库。
  3. Relatively self-contained... the less of my own javascript lying around, the better. 相对自足......我自己的javascript越少越好。

I'm aware that there are different styles of multiselect widget, eg an "available" list and a "selected" list vs a single list with select/deselect checkboxes vs autocomplete combobox... I'm open to any - it just has to be better than what I get for free with Roo. 我知道有多种不同风格的多选小部件,例如“可用”列表和“选定”列表与单个列表与选择/取消选中复选框与自动完成组合框...我对任何人开放 - 它只是有比Roo免费得到的更好。

Have you looked in dojox.form? 你看过dojox.form吗? Does CheckedMultiSelect help? CheckedMultiSelect有帮助吗?

I know this is a bit late in the game as you may have finished your project, but for future, I had problems with multiSelect widgets as those I was testing were modifying DOM so 我知道这在游戏中有点晚了,因为你可能已经完成了你的项目,但是对于未来,我遇到了multiSelect小部件的问题,因为我正在测试的是修改DOM所以

<select multiple="multiple">
    <option>...</option>
    ....
</select>
was effectively changed to something different like 被有效地改变成了不同的东西
 <div id="..."> <div id =“...”>\n    <input>... <输入> ...\n</div> </ DIV> 

I found one widget which works differently: it hides original select and creates its' own element and when user selects or deselects element it syncs its' state with original select. 我发现一个小部件的工作方式不同:它隐藏原始选择并创建其自己的元素,当用户选择或取消选择元素时,它会将其状态与原始选择同步。

It is called dropdown-check-list and here is the link dropdown-check-list 它被称为dropdown-check-list,这里是link dropdown-check-list

This way you can use original select for eg Spring binding. 这样你可以使用原始选择例如Spring绑定。

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

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