下拉框 实现多选等功能
function GetProjectInfoList1(o, callbreak) {
PostApi({ a: "GetProjectInfoList" }, function (data) {
console.log(data)
if (data.Error != 0) {
return;
}
o.empty();
o.append("<option value='-1'>请选择</option>")
for (var i = 0; i < data.Data.length; i++) {
var d = data.Data[i];
o.append("<option value='" + d.ProjectID + "' >" + d.Name + "</option>");
}
callbreak();
});
};
GetProjectInfoList1($("#ddlProjectInfo"), function () {
$("#ddlProjectInfo").multiselect({
nonSelectedText: '请选择项目', allSelectedText: '全部', maxHeight: 600, numberDisplayed: 0,
onChange: function (option, checked, select) {
console.log($("#ddlProjectInfo").val().length);
}
});
if ($("#txtProjectInfo").val() != "") {
$("#ddlProjectInfo").multiselect("select", $("#txtProjectInfo").val().split(","));
}
});