Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#5481 closed defect (wontfix)

FilteringSelect: user-supplied query ignored if it is against the store's identifier

Reported by: guest Owned by: Douglas Hays
Priority: high Milestone: 1.1
Component: Dijit - Form Version: 1.0
Keywords: filteringselect combobox query identifier Cc: frank.fortson@…
Blocked By: Blocking:

Description

Looks like a FilteringSelect?'s query is ignored when applied against the identifier field.

At or near line 239 in test_FilteringSelect.html is the test/example of a FilteringSelect? using the "query" parameter.

"name" is the identifier field in myStore2.

If the downArrow is made true and leaving the query based on the field "type:'country'", as below:

<p>FilteringSelect #11: deep data, initial query of type=country:</p>
<label for="state11">query list:</label>
<input searchAttr="name"
	dojoType="dijit.form.FilteringSelect"
	query={type:'country'}
	value="United States of America"
	name="state11"
	id="state11"
	autoComplete="false"
	store="myStore2"
	invalidMessage="Choose a country from the list."
	hasDownArrow="true"
>

the query works, e.g., Africa, a continent, is not listed, and Firebug reports:

>>> dijit.byId('state11').query
Object type=country name=*  //note name=* is included in the query, 
                            //even though not requested.

However, if the query is changed to "name:'U*'", as below:

<p>FilteringSelect #11: deep data, initial query of name:'U*':</p>
<label for="state11">query list:</label>
<input searchAttr="name"
	dojoType="dijit.form.FilteringSelect"
	query={name:'U*'}
	value="United States of America"
	name="state11"
	id="state11"
	autoComplete="false"
	store="myStore2"
	invalidMessage="Choose a country from the list."
	hasDownArrow="true"
>

the query does not work, e.g., all store items are listed, not just ones that begin with "U", and Firebug reports:

>>> dijit.byId('state11').query
Object name=*  //note not name=U*, as it should be

The Dojo Book defines the use of "query" as a user would expect: "A query that can be passed to 'store' to initially filter the items, before doing further filtering based on searchAttr and the key."

This may have always been this way, since it is in the 2007/10/08 build and the current nightly build.

Change History (4)

comment:1 Changed 12 years ago by bill

Milestone: 1.1
Owner: set to Douglas Hays

comment:2 Changed 12 years ago by Douglas Hays

(In [11954]) References #5481. Added comment to avoid confusion with query values.

comment:3 Changed 12 years ago by Douglas Hays

Resolution: wontfix
Status: newclosed

This is a limitation of the dojo.data query API. The query object can only have 1 name attribute, so there's no way to specify both U* and also the textbox text for the "name" attribute. I updated the 1.1 doc to say to not do this.

comment:4 Changed 9 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.