#12856 closed defect (fixed)
FilteringSelect: error with square brackets in default value
Reported by: | Florian | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Dijit - Form | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Hi,
dijit.form.FilteringSelect? (and probably dijit.form.ComboBox?) do not set the default-value correctly if it starts with a square bracket.
Example:
<select dojoType="dijit.form.FilteringSelect"> <option value="[alle Sachgebiete]" selected="selected">[alle Sachgebiete]</option> <option value="Angebot/Voranfrage">Angebot/Voranfrage</option> </select>
I think the culprit is the CSS-selector in method fetchItemByIdentity in dijit/form/ComboBox.js (line 1194 in dojo 1.6.1), but I do not find the correct selector by myself.
fetchItemByIdentity: function(/*Object*/ args){ // summary: // Given the identity of an item, this method returns the item that has // that identity through the onItem callback. // Refer to dojo.data.api.Identity.fetchItemByIdentity() for more details. // // description: // Given arguments like: // // | {identity: "CA", onItem: function(item){...} // // Call `onItem()` with the DOM node `<option value="CA">California</option>` // ----> incomplete css-selector? var item = dojo.query("> option[value='" + args.identity + "']", this.root)[0]; // ----> end incomplete css-selector? args.onItem(item); },
Regards,
Florian
p.s. version is 1.6.1, but it is missing in the select below
Change History (3)
comment:1 Changed 10 years ago by
Milestone: | 1.6.2 → 1.7 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Version: | 1.6.0 → 1.6.1 |
comment:2 Changed 10 years ago by
Hi Bill,
thanks for your answer. Is there no chance to get a fix for the 1.6 branch?
Florian
comment:3 Changed 10 years ago by
I doubt we'll have another 1.6 release, I assume you could monkey patch it by doing something like this in your code:
dijit.form.CheckBox.prototype. fetchItemByIdentity = ...
Note: See
TracTickets for help on using
tickets.
OK, just added a 1.6.1 for the version dropdown. Assuming the culprit is what you say, this should be fixed in 1.7 by my recent checkin to convert ComboBox to run against the new dojo.store API. It doesn't have that dojo.query() call at all anymore.