#12434 closed defect (invalid)
Select: can't select int values programmatically
Reported by: | milad | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Dijit - Form | Version: | 1.6.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
hi all i create dijit.form.Select programmatic,if one option have Int value i cant select it programmatic,see attachment please.
Attachments (2)
Change History (10)
Changed 10 years ago by
Attachment: | dijit.form.select.php added |
---|
comment:1 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|---|
Owner: | set to Douglas Hays |
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
Milestone: | tbd → 1.7 |
---|
Bill, the fix seems to be to loosen the type restrictions on a comparison (see patch). I can't find anything that this will break, but I'm not sure why the === was used in the first place. Any ideas?
comment:4 Changed 10 years ago by
Looking at _FormSelectWidget.js, it seems like value is required to be a string. That's how it's documented in dijit.form.__SelectOption
, plus multiple methods (getOptions() and removeOption()) can take either a number or string as an argument, but treat the number as an index (nth child) indicator.
See also #11545 and the patch attached there, which goes in the opposite direction (although I think that patch is stale).
So I don't think this ticket is invalid.
comment:5 Changed 10 years ago by
Summary: | Select:Int value cant select programmatic → Select: can't select int values programmatically |
---|
Oops, double negative, I meant that I think this ticket is invalid.
comment:6 Changed 10 years ago by
Bill has decided to keep numeric values reserved for indexing the options array.
comment:7 Changed 10 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:8 Changed 10 years ago by
For the record, I can see the value (no pun intended) of enhancing Select to allow numeric values, it's just that it confuses the current API because with a select list like:
<option value=10>...</option> <option value=20>...</option> <option value=30>...</option> ...
the meaning of
removeOption(10)
becomes unclear, it could be:
- remove the tenth option in the list
- remove the option with value == 10
ooghry - Is it just that you messed up the data types? You defined value as a number yet call attr(value, '2'), passing in a string.