#12373 closed enhancement (fixed)
ComboBox: support dojo.store
Reported by: | bill | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Dijit - Form | Version: | 1.6.0rc1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Enhance ComboBox to support connecting to a dojo.store by default. If ComboBox is created with a store parameter that's a dojo.data Object, then require() dojo.store.DataStore and use it to wrap the dojo.data store Object, converting it into a dojo.store.
Change History (18)
comment:1 follow-up: 4 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
comment:3 Changed 10 years ago by
comment:4 Changed 10 years ago by
Replying to bill:
(In [24654]) Enhance dijit's ComboBox and FilteringSelect to be able to source from the new dojo.store API.
<snip>
http://bugs.dojotoolkit.org/browser/dijit/trunk/form/FilteringSelect.js?rev=24654#L210 and http://bugs.dojotoolkit.org/browser/dijit/trunk/form/_AutoCompleterMixin.js?rev=24654#L556 both use this type of code
dojo.when(promise, function (result, error) { if (error) { // handle error } else { // handle result } });
afaik, unless something is happening that is not "normal" for promises, this won't work in the error case. it should be
dojo.when(promise, function (result) { // handle result }, function (error) { // handle error });
comment:5 Changed 10 years ago by
comment:6 Changed 10 years ago by
(In [25531]) Better backwards compatibility: make ComboBox.store point to the original store passed in as an initialization parameter (even when the store implements the old dojo.data API), and make the selected item (ComboBox.item) a native item from that store. If ComboBox.store is the old dojo.data API, adds methods to make it act more like the new API.
Refs #12373 !strict
comment:8 Changed 10 years ago by
what is the plan for dijit.form.Select or more specifically dijit.form._FormSelectWidget? currently only dojo.data is supported.
comment:9 Changed 10 years ago by
I'd like to get all the widgets supporting the new store API soon. Certainly by 2.0 (when we'll drop support for the old dojo.data API), but ideally for 1.8. No guarantees though.
comment:10 Changed 10 years ago by
Related to store conversion: should FilteringSelect? be a store Observer so that store changes that affect the query result set could be reflected in the FilteringSelect?'s validity (i.e. removing the FS's value item from the store should cause the FS to become invalid). Similar but unrelated to conversion, should FilteringSelect?.set('query') immediately result in a store.query() [again, to trigger a validation check]?
comment:11 Changed 10 years ago by
should FilteringSelect be a store Observer so that store changes that affect the query result set could be reflected in the FilteringSelect's validity
We could do that, although it comes at the cost of more code, and no one has requested it until now so it doesn't seem like anyone needs that.
Similar but unrelated to conversion, should FilteringSelect.set('query') immediately result in a store.query() [again, to trigger a validation check]?
Yes, technically that should happen, resetting the query could affect the validity or change the selected item. Again though it's an edge case that requires more code and not sure if it's worth it.
Anyway, neither of these issues has anything to do with this ticket.
(In [24654]) Enhance dijit's ComboBox and FilteringSelect to be able to source from the new dojo.store API. The old dojo.data API will be supported until 2.0.
Change dojox.mobile.ComboBox widget to source from the new dojo.store API rather than the old dojo.data API.
Add cancel() ability to dojo.store.DataStore?, to be able to cancel a fetch running on the underlying dojo.data store.
Fixes #12373 !strict