Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11498 closed defect (fixed)

FilteringSelect searchAttr/labelFunc examples broken.

Reported by: timtoo Owned by: bill
Priority: high Milestone: 1.6
Component: Documentation Version: 1.5
Keywords: Cc: tim-dojo@…
Blocked By: Blocking:

Description

This behavior can be seen on the current (v1.5) reference manual example page:

http://www.dojotoolkit.org/reference-guide/dijit/form/FilteringSelect.html

Specifically the "Custom displayed value/search text" and "Transforming the displayed value using labelFunc" examples. Both of them set the initial value of the control to "KY" (one first example is via markup, the second is programmatic), but after the widget loads the input is blank.

I have found using QueryReadStore? (v1.4.3) and watching the XHR calls that the initial query sent by the widget seems to be always using "id" for the searchAttr even though the searchAttr has been set to another value (as it has in the above examples). Subsequent queries in response to input do use the proper searchAttr, however. (I assume ItemFileReadStore? is behaving the same way, but I don't know how to monitor its queries.)

Change History (4)

comment:1 Changed 9 years ago by bill

Component: DijitDocumentation
Milestone: tbd1.6
Summary: FilteringSelect using ItemFileReadStore ignores searchAttr on initial queryFilteringSelect searchAttr/labelFunc examples broken.

Good catch on the broken example pages. It looks like it's just a problem with the example though, not with the code. You need to set the store as an initial parameter to the widget, not set it afterwards, and even if you could set it afterwards it would be via myWidget.set("store", ...) not myWidget.store = ... .

This works fine:

<div dojoType="dojo.data.ItemFileReadStore" jsId="myStore" url="dijit/tests/_data/states.json"></div>
<input dojoType="dijit.form.FilteringSelect" store="myStore" value="KY" id="fs" searchAttr="abbreviation"
name="abbreviatedstate">

I'll update the examples in the documentation.

comment:2 Changed 9 years ago by bill

Owner: set to bill

comment:3 Changed 9 years ago by bill

Resolution: fixed
Status: newclosed

comment:4 Changed 9 years ago by bill

(In [22615]) Noting that store needs to be specified at creation time, otherwise the initial value specified won't be processed correctly, refs #11498 !strict.

Note: See TracTickets for help on using tickets.