带有复选框的列表框 [英] listbox with checkboxes

查看:23
本文介绍了带有复选框的列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,在我的 asp.net mvc 应用程序中,我有一个呈现如下的列表框:

Greetings, in my asp.net mvc application I have a listbox rendered as follows:

<%= Html.ListBox("localization", (Model as SeekWeb.Models.CreateMessageViewModel).Localizations.AsEnumerable())%>

有没有办法为每个列表框项目设置复选框?如果选中复选框,则选择相应的列表框项.

is there any way to have checkbox for each listbox item? if checkbox is checked then the appropriate listbox item is selected.

推荐答案

我使用一个时髦的小 jQuery 插件 - jQuery Multiselect - 将列表框变成更用户友好的复选框.主题滚轮也准备好了!

I use a funky little jQuery plugin - jQuery Multiselect - to turn listboxes into more user friendly checkboxes. It's themeroller ready too!

是的,它确实依赖于启用 JS 的用户,但它确实会优雅地降级为标准列表框.

Yeah, it does rely on the user having JS enabled but it does degrade gracefully to the standard listbox.

HTH,
查尔斯

HTHs,
Charles

这篇关于带有复选框的列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆