本文實例為大家分享了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)下拉框多選
Copyright ? 2019- 91gzw.com 版權(quán)所有 湘ICP備2023023988號-2
違法及侵權(quán)請聯(lián)系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市萬商天勤律師事務(wù)所王興未律師提供法律服務(wù)