Jquery implements multiple selection in the drop-down box and multiple selection in the jquery drop-down box

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.