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>
|
||||
<pre class="prettyprint linenums" id="code_e4"></pre>
|
||||
<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>
|
||||
<pre class="prettyprint linenums">
|
||||
<select>
|
||||
@ -352,7 +352,8 @@ version: 2.1
|
||||
</pre>
|
||||
<pre class="prettyprint linenums">
|
||||
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;
|
||||
}
|
||||
</pre>
|
||||
@ -789,8 +790,8 @@ version: 2.1
|
||||
<tr><td><returns></td><td>string</td><td>Html that represents the selection</td></tr>
|
||||
</table>
|
||||
The default implementation expects the object to have a <code>text</code> property that is returned.
|
||||
<br>
|
||||
Original <option> (or <optgroup>) element is accessible inside the specified function by property item.element
|
||||
<br><br>
|
||||
Original <code><option></code> (or <code><optgroup></code>) element is accessible inside the specified function by property <code>item.element</code>:
|
||||
<pre>
|
||||
format(item) {
|
||||
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>
|
||||
</table>
|
||||
The default implementation expects the object to have a <code>text</code> property that is returned.
|
||||
<br>
|
||||
Original <option> (or <optgroup>) element is accessible inside the specified function by property item.element
|
||||
<br><br>
|
||||
Original <code><option></code> (or <code><optgroup></code>) element is accessible inside the specified function by property <code>item.element</code>:
|
||||
<pre>
|
||||
format(item) {
|
||||
var originalOption = item.element;
|
||||
|
Loading…
Reference in New Issue
Block a user