|
@@ -2,24 +2,24 @@
|
|
<h2 id="data-attributes">
|
|
<h2 id="data-attributes">
|
|
Can I declare my configuration within the HTML?
|
|
Can I declare my configuration within the HTML?
|
|
</h2>
|
|
</h2>
|
|
-
|
|
|
|
|
|
+
|
|
<p>
|
|
<p>
|
|
It is recommended that you declare your configuration options for Select2
|
|
It is recommended that you declare your configuration options for Select2
|
|
when initializing Select2. You can also define your configuration options
|
|
when initializing Select2. You can also define your configuration options
|
|
by using the HTML5 <code>data-*</code> attributes, which will override
|
|
by using the HTML5 <code>data-*</code> attributes, which will override
|
|
any options set when initializing Select2 and any defaults.
|
|
any options set when initializing Select2 and any defaults.
|
|
</p>
|
|
</p>
|
|
-
|
|
|
|
|
|
+
|
|
<h3>
|
|
<h3>
|
|
How should <code>camelCase</code> options be written?
|
|
How should <code>camelCase</code> options be written?
|
|
</h3>
|
|
</h3>
|
|
-
|
|
|
|
|
|
+
|
|
<p>
|
|
<p>
|
|
This means that if you declare your <code><select></code> tag as...
|
|
This means that if you declare your <code><select></code> tag as...
|
|
</p>
|
|
</p>
|
|
|
|
|
|
<pre class="prettyprint">
|
|
<pre class="prettyprint">
|
|
-<select data-tags="true" data-placeholder="Select an option"></select>
|
|
|
|
|
|
+<select data-tags="true" data-placeholder="Select an option" data-allow-clear="true"></select>
|
|
</pre>
|
|
</pre>
|
|
|
|
|
|
<p>
|
|
<p>
|
|
@@ -29,14 +29,15 @@
|
|
<pre class="prettyprint linenums">
|
|
<pre class="prettyprint linenums">
|
|
$("select").select2({
|
|
$("select").select2({
|
|
tags: "true",
|
|
tags: "true",
|
|
- placeholder: "Select an option"
|
|
|
|
|
|
+ placeholder: "Select an option",
|
|
|
|
+ allowClear: true
|
|
});
|
|
});
|
|
</pre>
|
|
</pre>
|
|
-
|
|
|
|
|
|
+
|
|
<h3>
|
|
<h3>
|
|
Are options with nested configurations supported?
|
|
Are options with nested configurations supported?
|
|
</h3>
|
|
</h3>
|
|
-
|
|
|
|
|
|
+
|
|
<p>
|
|
<p>
|
|
You can also define nested configurations, which are typically needed for
|
|
You can also define nested configurations, which are typically needed for
|
|
options such as AJAX. Each level of nesting should be separated by two
|
|
options such as AJAX. Each level of nesting should be separated by two
|