下载及代码: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]
常用及汉化:
默认选中:
$("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]
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();
}
}