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

這個(gè)沒什么說的,直接引入css和js文件和圖片,調(diào)用js即可。下面是源碼:
<html>
<head>
<meta charset="utf-8" />
<title>利用EasyUI實(shí)現(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>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
深入淺析ng-bootstrap 組件集中 tabset 組件的實(shí)現(xiàn)分析
jQuery插件FusionCharts繪制的2D條狀圖效果【附demo源碼】
基于JQuery實(shí)現(xiàn)滾動(dòng)到頁面底端時(shí)自動(dòng)加載更多信息
jQuery實(shí)現(xiàn)文本顯示一段時(shí)間后隱藏的方法分析
jQuery 鼠標(biāo)經(jīng)過(hover)事件的延時(shí)處理示例
jQuery 實(shí)現(xiàn)批量提交表格多行數(shù)據(jù)的方法
jquery動(dòng)態(tài)導(dǎo)航插件dynamicNav用法實(shí)例分析
jQuery實(shí)現(xiàn)簡(jiǎn)單評(píng)論區(qū)

