jQuery ui 多选下拉

下载及代码:http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/index.htm#filter

api(参数):http://www.erichynds.com/blog/jquery-ui-multiselect-widget

Demo:http://www.erichynds.com/examples/jquery-multiselect/examples.htm

效果:

[img]http://dl2.iteye.com/upload/attachment/0101/4673/3cf54b23-b32f-3edd-9291-85ab81e2dcfe.png[/img]

自己使用:

[img]http://dl2.iteye.com/upload/attachment/0101/4728/b2c3f378-a7c4-3a72-8aef-bf7aa3ec040e.png[/img]

常用及汉化:

$("#assignUserId").multiselect({
header: "选择处理人",
noneSelectedText: "未选择",
checkAllText: "选择全部",
uncheckAllText: "取消全部",
minWidth:150,
selectedText: function(numChecked, numTotal, checkedItems){
return $(checkedItems[0]).next('span').html();
}
});


var array_of_checked_values = $("#assignUserId").multiselect("getChecked").map(function(){
return this.value;
}).get();




默认选中:

$("select option:nth-child(1), select option:nth-child(3)").attr("selected", "selected");
$("select").multiselect("refresh");


获得选中:
var array_of_checked_values = $("#assignUserId").multiselect("getChecked").map(function(){
return this.value;
}).get();


[img]http://dl2.iteye.com/upload/attachment/0101/4757/45a9ebe9-6e19-3788-aa23-683e5cb6a9ca.png[/img]



配置:
defaultMultiselectOptions : {
header: false,
noneSelectedText: "请选择",
checkAllText: "选择全部",
uncheckAllText: "取消全部",
minWidth:150,
selectedText: function(numChecked, numTotal, checkedItems){
return $(checkedItems).map(function(){
return $(this).next('span').html();
}).get();
}
}


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值