多选择ListBox没有pressing CTRL [英] Multiple select listbox without pressing CTRL

查看:221
本文介绍了多选择ListBox没有pressing CTRL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这是很容易做到,但我不能找到一种方法。

I thought this would be easy to do but I can't find a way.

我有选择模式的列表框设置为多,但我的用户希望能够选择多个项目,而不必preSS CTRL。

I have a ListBox with selection mode set to multiple but I the user wants to be able to select multiple items without having to press CTRL.

有谁知道一个简单的方法来做到这一点?

Does anyone know an easy way to do this?

推荐答案

Google搜索它,找到以下内容: http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/

Googled it and find the following: http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/

下面是一些提示:

刚刚类型:

$(function(){
   $("select").multiselect(); 
});

当然,你需要引用jQuery的为好,和CSS,使它看起来不错。

Of course you need to reference jQuery as well, and the css to make it look good.

什么是小部件的作用是,它需要一个选择列表,并把它创建一个围绕它的复选框和样式列表他们正常。

What the widget does is that it takes an select list and turn it create a list of checkboxes around it and styles them properly.

一个简单的例子的jsfiddle我放在一起: http://jsfiddle.net/AFVfQ/1/

A simple jsfiddle example I put together: http://jsfiddle.net/AFVfQ/1/

它不是完美的,但它应该告诉你它是如何工作的。注意在左侧的资源中,我引用jQuery UI的CSS和主题。

It is not perfect, but it should show you how it works. Note the resources on the left hand side, the I'm referencing jquery ui css and a theme.

这篇关于多选择ListBox没有pressing CTRL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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