EasyUI實現(xiàn)下拉框多選功能
本文實例為大家分享了EasyUI實現(xiàn)下拉框多選展示的具體代碼,供大家參考,具體內(nèi)容如下
效果圖:

這個沒什么說的,直接引入css和js文件和圖片,調(diào)用js即可。下面是源碼:
<html>
<head>
<meta charset="utf-8" />
<title>利用EasyUI實現(xiàn)多選下拉框</title>
<link rel="stylesheet" type="text/css" href="css/easyui.css" rel="external nofollow" />
<style type="text/css">
ul{
width: 200px !important;
}
li{
width: 50px !important;
float: left !important;
}
</style>
<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(function () {
$('#ddlLine').combotree({
valueField: "id", //Value字段
textField: "text", //Text字段
multiple: true,
data: [{ "id": 1, "text": "All", "children": [{ "id": 13, "text": "C1" }, { "id": 14, "text": "C2" }, { "id": 15, "text": "C3"}]}],
// url: "tree_data2.json", //數(shù)據(jù)源
onCheck: function (node, checked) {
//讓全選不顯示
$("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全選,", ""));
},
onClick: function (node, checked) {
//讓全選不顯示
$("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全選,", ""));
}
});
})
</script>
</head>
<body>
多選:<select id="ddlLine" class="easyui-combotree" style="width: 205px; height: 24px;">
</select>
</body>
</html>
下載地址:EasyUI實現(xiàn)下拉框多選
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
深入淺析ng-bootstrap 組件集中 tabset 組件的實現(xiàn)分析
jQuery插件FusionCharts繪制的2D條狀圖效果【附demo源碼】
基于JQuery實現(xiàn)滾動到頁面底端時自動加載更多信息
jQuery實現(xiàn)文本顯示一段時間后隱藏的方法分析
jQuery 鼠標經(jīng)過(hover)事件的延時處理示例
jQuery 實現(xiàn)批量提交表格多行數(shù)據(jù)的方法
jquery動態(tài)導航插件dynamicNav用法實例分析

