#16953 closed enhancement (fixed)
Select: support .set('query', ...) and .set('queryOptions',...)
Reported by: | ractive | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.10 |
Component: | Dijit - Form | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When setting the query of a store backed dijit/form/Select like mySelect.set("query", myQuery)
, the options are not updated.
As a workaround, one has to call mySelect.setStore(mySelect.store)
to force a refresh of the select box.
Looking at the code in _FormSelectWidget.js the setStore() method really is the only place where the store is queried.
Expected behaviour: The select box's options should be updated when setting the query options of a select box.
See also the posting in the mailing list.
Attachments (1)
Change History (9)
comment:1 Changed 8 years ago by
Changed 8 years ago by
Attachment: | 16953.patch added |
---|
Add set("query") enhancement to select API. Fixes #16953.
comment:2 Changed 8 years ago by
Milestone: | tbd → 1.10 |
---|---|
Owner: | changed from Douglas Hays to haysmark |
Status: | new → assigned |
Type: | defect → enhancement |
In addition to the workaround you suggested, the current way to set the query is to use the setStore(store,value,fetchArgs) signature to specify the query as part of the fetchArgs in one call. This way you can also set properties like sort order etc.
I attached an implementation but I have concerns that this enhancement will spill over to other widgets like ComboBox?, which I believe also have fetchArgs by other names. I would wait for 1.9 RC to branch before committing this.
comment:3 Changed 8 years ago by
Also worth noting that a) the query was not taking effect on the first set call and b) Selects created from options ignore the query.
comment:4 Changed 8 years ago by
Summary: | dijit/form/Select does not update after setting the query parameter → [patch] dijit/form/Select does not update after setting the query parameter |
---|
comment:5 Changed 7 years ago by
Priority: | undecided → high |
---|---|
Type: | enhancement → defect |
comment:6 Changed 7 years ago by
Owner: | changed from haysmark to bill |
---|
comment:7 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 Changed 7 years ago by
Summary: | [patch] dijit/form/Select does not update after setting the query parameter → Select: support .set('query', ...) and .set('queryOptions',...) |
---|---|
Type: | defect → enhancement |
See also #11676, it's somewhat related.