#5772 closed defect (fixed)
dijit.form._ComboBoxDataStore not complete
Reported by: | nathan | Owned by: | nathan |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit - Form | Version: | 1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
The dijit.form._ComboBoxDataStore doesn't fully implement the data api - it needs to implement a getFeatures() function:
getFeatures: function(){ return {"dojo.data.api.Read": true, "dojo.data.api.Identity": true};}
should be sufficient for it.
Also - the fetch() function isn't happy if query or queryOptions is missing. It might be nice to do something like:
if (!args.query){ args.query = {}; } if (!args.query.name){ args.query.name = "*";} if (!args.queryOptions){ args.queryOptions = {};}
at the beginning of the fetch() function
Attachments (2)
Change History (15)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Scope is also not honored - nor is onBegin or onItem...it might be easiest to mixin dojo.data.util.simpleFetch and implement _fetchItems instead.
Changed 13 years ago by
Attachment: | combobox.patch added |
---|
Patch to add getFeatures to combobox and leverage simpleFetch for better fetching compatibility
comment:3 Changed 13 years ago by
Cc: | [email protected]… removed |
---|---|
Component: | General → Dijit |
Owner: | anonymous deleted |
Reporter: | changed from guest to [email protected]… |
That's correct, by design dijit.form._ComboBoxDataStore doesn't implement the full dojo.data.store API. Is there an actual problem with ComboBox? that you are seeing?
comment:4 Changed 13 years ago by
The issue I'm seeing isn't with ComboBox? itself...it's with a subclass of it that I've created. In 1.0, the ComboBox? mixin used an ItemFileReadStore? to represent its data - so my subclass of it keys off of the fact that it's a "real" datastore (passing in scope for fetch, and using getFeatures to determine if it's a read-only store or if it supports writing.)
I can change my subclass - it's not a huge deal - but I would suggest that fully implementing the dojo.data.api.Read api should be done if it's really "using" a datastore. If, for performance reasons, it is better not to implement the full API, then I would suggest not calling it a "store" - to avoid confusion when subclassing.
comment:5 Changed 13 years ago by
Milestone: | → 1.2 |
---|
Hi Nathan,
OK, that makes sense. The reason I didn't implement the full store API was to reduce the code size, but it looks like your patch is pretty small so I guess we can integrate it.
Have you signed the CLA?
comment:7 Changed 13 years ago by
I faxed in a CLA earlier today - I didn't get any sort of receipt confirmation back or anything, if that's needed.
comment:8 Changed 13 years ago by
Reporter: | changed from [email protected]… to nathan |
---|
comment:9 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Owner: | set to bill |
comment:10 Changed 13 years ago by
Owner: | changed from bill to nathan |
---|
OK, Nathan's a committer now so I will let him check in the patch.
comment:11 Changed 13 years ago by
Status: | new → assigned |
---|
Changed 13 years ago by
Attachment: | ComboBox_storeFeatures-5772-trunk-2008-04-10_0841.diff added |
---|
Updated patch.
comment:13 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
Sorry - forgot to mention - this is from an svn snapshot from this morning.