Jquery implements multiple selection in the drop-down box and multiple selection in the jquery drop-down box
I. Description
This article uses EasyUI to implement the multi-choice feature of the drop-down box. Based on the original ComboxTree, the style sheet has been uploaded to the demo. The Code is as follows:
Ii. Code
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "> <Head> <title> Use EasyUI to select multiple drop-down lists </title> <link rel =" stylesheet "type =" text/css "href =" EasyUI/easyui.css "/> <script type = "text/javascript" src = "EasyUI/jquery. min. js "> </script> <script type =" text/javascript "src =" EasyUI/jquery. easyui. min. js "> </script> <script type =" text/javascript "> $ (function () {$ ('# ddlline '). combotree ({valueField: "id", // Value Field textField: "text", // Text field multiple: true, data: [{"id": 1, "text": "All", "children": [{"id": 13, "text": "C1" },{ "id": 14, "text ": "C2" },{ "id": 15, "text": "C3"}], // url: "tree_data2.json", // data source onCheck: function (node, checked) {// do not display all values $ ("# ddlLine "). combotree ("setText", $ ("# ddlLine "). combobox ("getText "). toString (). replace ("select all,", "") ;}, onClick: function (node, checked) {// do not display all values $ ("# ddlLine "). combotree ("setText", $ ("# ddlLine "). combobox ("getText "). toString (). replace ("select all,", "") ;}}) ;}) </script>
Iii. Effect
4. Download
DEMO
Author: Paths QQ: 2490024434
Source: http://www.cnblogs.com/lengzhan/
This article is copyrighted by [Cold War] And the blog Park. You are welcome to repost it to your favorites. You must retain this statement without the author's consent. Otherwise, you will be entitled to pursue legal liability.