Ticket #5481 (closed defect: wontfix)
FilteringSelect: user-supplied query ignored if it is against the store's identifier
| Reported by: | guest | Owned by: | doughays |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1 |
| Component: | Dijit | Version: | 1.0 |
| Severity: | normal | Keywords: | filteringselect combobox query identifier |
| Cc: | frank.fortson@… |
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.