[SELECT2] Full Options (ok)
https://jeesite.gitee.io/front/jquery-select2/4.0/options.htm
Core options
How should Select2 be initialized?
1$('select').select2();
123$('select').select2({ placeholder: 'Select an option'});Can default options be set for all dropdowns?
1$.fn.select2.defaults.set("theme", "classic");How can I set a default value for a nested option?
How can I reset all of the global default options?
Can I declare my configuration within the HTML?
How should camelCase options be written?
camelCase options be written?Are options with nested configurations supported?
Can I use Select2 with my AMD or CommonJS loader?
How do I tell Select2 where to look for modules?
Select2 is being placed before jQuery in my JavaScript file
Should I point to the files in dist or src?
dist or src?Data adapters
Can Select2 be used with a <select> tag?
<select> tag?Does Select2 support nesting options?
How many levels of nesting can there be?
Can <optgroup> tags be made selectable?
<optgroup> tags be made selectable?How are <option> and <optgroup> tags serialized into data objects?
<option> and <optgroup> tags serialized into data objects?Can I load data into Select2 using an array?
What properties are required on the objects passed in to the array?
Do the id properties have to be strings?
id properties have to be strings?I can't select results with blank ids or an id of 0!
0!How should nested results be formatted?
How many levels of nesting are allowed?
Why are <option> tags being created?
<option> tags being created?My objects don't use id for their unique identifiers, what can I do?
id for their unique identifiers, what can I do?My objects use a property other than text for the text that needs to be displayed
text for the text that needs to be displayedCan Select2 be connected to a remote data source?
How can I set the initially selected options when using AJAX?
What should the results returned to Select2 look like?
Is there a way to modify the response before passing it back to Select2?
A request is being triggered on every key stroke, can I delay this?
How do I tell Select2 which URL to get the results from?
I want to add more query parameters to the request, where can this be done?
The results that I am seeing never change
Can an AJAX plugin other than jQuery.ajax be used?
jQuery.ajax be used?How to programmatically access a selection data?
Displaying selections
Can I allow users to make multiple selections?
Can the multiple attribute be used on my <select> element?
multiple attribute be used on my <select> element?How can I have Select2 display a placeholder?
My first option is being displayed instead of my placeholder
I am using AJAX, can I still show a placeholder?
Can I use an option without a blank value as my placeholder?
Can I change how the placeholder looks?
My placeholders aren't being displayed in Internet Explorer
Can I allow users to clear their selections?
Why is a placeholder required?
The "x" icon is not clearing the selection
Can users remove all of their selections in a multiple select at once?
How can I customize the way selections are displayed?
Nothing is being displayed when I select an option
I am using HTML in my selection template but it isn't displaying it
How can I access the container where the selection is displayed?
Displaying results
Can I change when search results are loaded?
Can Select2 wait until the user has typed a search term before triggering the request?
Select2 is allowing long search terms, can this be prevented?
I only want the search box if there are enough results
How can I permanently hide the search box?
Can I change how selecting results works?
Can I select the highlighted result when the dropdown is closed?
Can I prevent the dropdown from closing when a result is selected?
Can options be created based on the search term?
How do I enable tagging?
Does tagging work with a single select?
How do I add extra properties to the tag?
Can I control when tags are created?
How do I control the placement of the option?
Can I change how the dropdown is placed?
Can the dropdown be placed directly after the selection container?
Can I pick an element for the dropdown to be appended to?
I'm using a Bootstrap modal and I can't use the search box
I'm using jQuery UI and I can't use the search box
Events
Public jQuery events
What events will Select2 trigger?
Does Select2 include extra information in these events?
How can I attach listeners for these events?
What events does Select2 listen for?
Can I trigger an event other than change to notify Select2 of changes?
change to notify Select2 of changes?What events can be prevented? How can I prevent a selection from being made?
Internal Select2 events
Backwards compatibility
Simplified function for matching data objects
Old initial selections with initSelection
initSelectionQuerying old data with query
queryCompatibility with <input type="text" />
<input type="text" />Last updated