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

发布于 2024-10-02 17:45:17 字数 416 浏览 5 评论 0原文

我正在寻找一个 Javascript 多重选择来在我的 Spring Roo / Web MVC 项目上使用,并担心我可能会花一些时间从库中添加一个小部件,然后破坏其他东西。要求:

  1. 比 Roo 在搭建多对多关系时使用的标准 Dojo 多重选择更漂亮、更实用,即用户不必按住 ctrl 或 Shift 来选择多个项目。
  2. 与 Roo 脚手架中已经使用的 javascript 配合得很好 - 所以我猜这意味着一等奖是构建在 Dojo 之上的东西,尽管我并不完全反对添加其他库。
  3. 相对独立...我自己的 javascript 越少越好。

我知道有不同风格的多选小部件,例如“可用”列表和“选定”列表与带有选择/取消选择复选框的单个列表与自动完成组合框...我对任何类型都持开放态度 - 它只是有比我从 Roo 免费获得的东西更好。

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. 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.
  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.
  3. Relatively self-contained... the less of my own javascript lying around, the better.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

素衣风尘叹 2024-10-09 17:45:17

您查看过 dojox.form 吗? CheckedMultiSelect 有帮助吗?

Have you looked in dojox.form? Does CheckedMultiSelect help?

动次打次papapa 2024-10-09 17:45:17

我知道这有点晚了,因为你可能已经完成了你的项目,但对于未来,我在 multiSelect 小部件方面遇到了问题,因为我正在测试的小部件正在修改 DOM,所以

<select multiple="multiple">
    <option>...</option>
    ....
</select>

was effectively changed to something different like

<div id="...">
    <input>...
</div>

我发现一个小部件的工作方式不同:它隐藏原始选择并创建自己的元素,当用户选择或取消选择元素时,它会将其状态与原始选择同步。

它称为 dropdown-check-list,这里是链接 dropdown-check-list

这样您就可以使用原始选择来进行例如 Spring 绑定。

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

<select multiple="multiple">
    <option>...</option>
    ....
</select>

was effectively changed to something different like

<div id="...">
    <input>...
</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

This way you can use original select for e.g. Spring binding.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文