views:

127

answers:

1

What are the requirements for formatting a 'store' used by a dijit.form.Select?

Currently i'm pulling a json style db (backend is a mongoStore) and using THE SAME DB in a dojox.data.DataGrid and a dijit.form.Select. I set the db as the 'store' attribute for both, and for the datagrid it works perfectly (after specificying the layout).

This works....

        this.setGrid = new dojox.grid.DataGrid({
            store: this.db,
            structure: this.setGridLayout
        });

In the Select however it does not work at all. In the drop down i get thin blank spaces roughly equivalent in number to the number of objects in the db. What do i need to specify in the select/how do i need to format the data so that the select can display the data correctly?

This doesnt work...

    var select = new dijit.form.Select({
        id:dbName+"Select",
        store: this.db
    });
A: 

I don't know mongoStore and I've tried only with a dojo.data.ItemFileReadStore, so I don't know if what I write is useful for you.

I think that the Select's options are created using store.getLabel() and store.getIdentity(), see the function _getOptionObjForItem of dijit.form._FormSelectWidget.

ssambi