added 'add reference to original option element' in doc
This commit is contained in:
parent
2054fd9870
commit
feba7892ac
13
index.html
13
index.html
@ -342,7 +342,7 @@ version: 2.1
|
|||||||
<h3>Example Code</h3>
|
<h3>Example Code</h3>
|
||||||
<pre class="prettyprint linenums" id="code_e4"></pre>
|
<pre class="prettyprint linenums" id="code_e4"></pre>
|
||||||
<p>
|
<p>
|
||||||
You can set <code>data-</code> attributes to <option> (or <optgroup>) and use them inside temptlating functions:
|
You can set <code>data-</code> attributes to <code><option></code> (or <code><optgroup></code>) and use them inside temptlating functions:
|
||||||
</p>
|
</p>
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
<select>
|
<select>
|
||||||
@ -352,7 +352,8 @@ version: 2.1
|
|||||||
</pre>
|
</pre>
|
||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
function format(state) {
|
function format(state) {
|
||||||
var originalOption = state.element
|
var originalOption = state.element;
|
||||||
|
|
||||||
return "<img class='flag' src='images/flags/" + state.id.toLowerCase() + ".png' alt='" + originalOption.data('foo') + "' />" + state.text;
|
return "<img class='flag' src='images/flags/" + state.id.toLowerCase() + ".png' alt='" + originalOption.data('foo') + "' />" + state.text;
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
@ -789,8 +790,8 @@ version: 2.1
|
|||||||
<tr><td><returns></td><td>string</td><td>Html that represents the selection</td></tr>
|
<tr><td><returns></td><td>string</td><td>Html that represents the selection</td></tr>
|
||||||
</table>
|
</table>
|
||||||
The default implementation expects the object to have a <code>text</code> property that is returned.
|
The default implementation expects the object to have a <code>text</code> property that is returned.
|
||||||
<br>
|
<br><br>
|
||||||
Original <option> (or <optgroup>) element is accessible inside the specified function by property item.element
|
Original <code><option></code> (or <code><optgroup></code>) element is accessible inside the specified function by property <code>item.element</code>:
|
||||||
<pre>
|
<pre>
|
||||||
format(item) {
|
format(item) {
|
||||||
var originalOption = item.element;
|
var originalOption = item.element;
|
||||||
@ -807,8 +808,8 @@ version: 2.1
|
|||||||
<tr><td><returns></td><td>string</td><td>Html that represents the result</td></tr>
|
<tr><td><returns></td><td>string</td><td>Html that represents the result</td></tr>
|
||||||
</table>
|
</table>
|
||||||
The default implementation expects the object to have a <code>text</code> property that is returned.
|
The default implementation expects the object to have a <code>text</code> property that is returned.
|
||||||
<br>
|
<br><br>
|
||||||
Original <option> (or <optgroup>) element is accessible inside the specified function by property item.element
|
Original <code><option></code> (or <code><optgroup></code>) element is accessible inside the specified function by property <code>item.element</code>:
|
||||||
<pre>
|
<pre>
|
||||||
format(item) {
|
format(item) {
|
||||||
var originalOption = item.element;
|
var originalOption = item.element;
|
||||||
|
Loading…
Reference in New Issue
Block a user