Opened 12 years ago

Closed 11 years ago

Last modified 8 years ago

#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 Douglas Hays)

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)

combobox.patch (2.0 KB) - added by guest 12 years ago.
Patch to add getFeatures to combobox and leverage simpleFetch for better fetching compatibility
ComboBox_storeFeatures-5772-trunk-2008-04-10_0841.diff (2.4 KB) - added by nathan 11 years ago.
Updated patch.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 12 years ago by guest

Sorry - forgot to mention - this is from an svn snapshot from this morning.

comment:2 Changed 12 years ago by guest

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 12 years ago by guest

Attachment: combobox.patch added

Patch to add getFeatures to combobox and leverage simpleFetch for better fetching compatibility

comment:3 Changed 12 years ago by bill

Cc: nathan@… removed
Component: GeneralDijit
Owner: anonymous deleted
Reporter: changed from guest to nathan@…

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 12 years ago by guest

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 12 years ago by bill

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:6 Changed 12 years ago by guest

No - I haven't...I need to though. :)

comment:7 Changed 12 years ago by guest

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 11 years ago by nathan

Reporter: changed from nathan@… to nathan

comment:9 Changed 11 years ago by Douglas Hays

Description: modified (diff)
Owner: set to bill

comment:10 Changed 11 years ago by bill

Owner: changed from bill to nathan

OK, Nathan's a committer now so I will let him check in the patch.

comment:11 Changed 11 years ago by nathan

Status: newassigned

Changed 11 years ago by nathan

Updated patch.

comment:12 Changed 11 years ago by nathan

Resolution: fixed
Status: assignedclosed

Fixed in [13300]

comment:13 Changed 8 years ago by bill

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