Select2 Error Point Summary

Source: Internet
Author: User

1, in the official online example, there has been no search box out, has been the ordinary <select> tag to achieve the effect of it. Tangled up for a long time did not know what happened, later open the browser developer tool, found that prompted the following figure error:

Suddenly realized that he was a fool, Select2 is a plug-in based on jquery, no reference jquery,select2 swelling may be useful. I'm so stupid,-_-!.
Also blame oneself is not good, direct the code of the Guan net to write once to run directly.

2, in the implementation of adding placeholder effect to select2, the problem of placeholder does not work, ah, really tangled up for a long time, finally please vision to help look at, only to find that The original is that I did not give Select2 a placeholder opportunity, did not give Select2 an empty option,select2 swollen there is a place to show placeholder to show the content of it .

3, when doing SELECT2 data array, need to pay attention to two points: (1) to use the <input type= "hidden" > label instead of <select> label; (2) Each data in the array must have an ID and a text two field.
Also, when I was doing this example, I accidentally wrote a colon in the code, causing the Select2 control to load on the page, but I learned to find the error through the developer tool:

Parameter minimuminputlength,allowclear are case-sensitive and are not effective if the case is incorrect

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.