Add documentation on ids needing to be strings
This closes https://github.com/select2/select2/issues/4052 This closes https://github.com/select2/select2/pull/4076 This closes https://github.com/select2/select2/issues/4227
This commit is contained in:
parent
72d905f9e0
commit
3783354d02
@ -33,6 +33,26 @@ $('select').select2({
|
||||
included on the data objects that Select2 exposes.
|
||||
</p>
|
||||
|
||||
<h3>
|
||||
Do the <code>id</code> properties have to be strings?
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
Because the <code>value</code> attributes on a <code>>select<</code>
|
||||
tag must be strings, the <code>id</code> property on the data objects must
|
||||
also be strings. Select2 will attempt to convert anything that is not a
|
||||
string to a string, which will work for most situations, but it is
|
||||
recommended to force all of your ids to strings ahead of time.
|
||||
</p>
|
||||
|
||||
<h3>
|
||||
I can't select results with blank ids or an id of <code>0</code>!
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
See <a href="#do-the-id-properties-have-to-be-strings">Do the <code>id</code> properties have to be strings?</a>.
|
||||
</p>
|
||||
|
||||
<h3>
|
||||
How should nested results be formatted?
|
||||
</h3>
|
||||
|
Loading…
Reference in New Issue
Block a user