列表框与复选框 [英] listbox with checkboxes

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

问题描述

问候,
在我的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的多选 - 打开列表框为更多的用户友好的复选框。它的ThemeRoller准备呢!

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.

HTHS,结果
查尔斯

HTHs,
Charles

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

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