jquery.multi-select.js操作

郜光明
2023-12-01

$('#searchCity').multiSelect({
// selectableOptgroup: true,//Click on optgroup will select all nested options when set to true.
// keepOrder: true,
afterSelect: function(values){
console.log("values:"+values.toString());
$.each(values,function(i,v){
if($.inArray(v,selectItem)<=-1){
selectItem.push(v);
}
});
console.log("afterSelect:"+selectItem.toString());
},
afterDeselect: function(values){
selectItem.splice($.inArray(values,selectItem),1);
}
});

//最简单的使用方法
$('#searchCity').multiSelect();

//更多内容请看附件,附件中附有网页demo
 类似资料: