Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#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)

16953.patch (1013 bytes) - added by haysmark 7 years ago.
Add set("query") enhancement to select API. Fixes #16953.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 7 years ago by bill

See also #11676, it's somewhat related.

Changed 7 years ago by haysmark

Attachment: 16953.patch added

Add set("query") enhancement to select API. Fixes #16953.

comment:2 Changed 7 years ago by haysmark

Milestone: tbd1.10
Owner: changed from Douglas Hays to haysmark
Status: newassigned
Type: defectenhancement

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 7 years ago by haysmark

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 7 years ago by haysmark

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 5 years ago by dylan

Priority: undecidedhigh
Type: enhancementdefect

comment:6 Changed 5 years ago by bill

Owner: changed from haysmark to bill

comment:7 Changed 5 years ago by Bill Keese <bill@…>

Resolution: fixed
Status: assignedclosed

In c8bfd2a69c5148a27bebd35236a75f411b3d61ef/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:8 Changed 5 years ago by bill

Summary: [patch] dijit/form/Select does not update after setting the query parameterSelect: support .set('query', ...) and .set('queryOptions',...)
Type: defectenhancement
Note: See TracTickets for help on using tickets.