0
votes

Is it possible to use an Observable store with dijit/form/Select?

I wrapping a Memory store in an Observable instance for dGrid data. I would like to do the same for the Select instances in the grid editor columns.

I need to do this weird ObjectStore wrapping for stores with Selects. So I have doubts that using an Observable instance would just work.

                var fieldsStore = this.fieldStore = new ObjectStore(new Memory({data: [
                    {id: 'Title', label: 'Title'},
                    {id: 'Amount', label: 'Amount'},
                    {id: 'Date', label: 'Date'}
                ]}));

If it does work, should I pass the ObjectStore or Memory to the Observable?

2

2 Answers

0
votes

I think that I figured it out. This actually seems to work.

                var dataStore = new Memory({data: [
                    {id: 'Title', label: 'Title'},
                    {id: 'Amount', label: 'Amount'},
                    {id: 'Date', label: 'Date'}
                ]});
                var fieldStore = this.fieldStore = new Observable(new ObjectStore(dataStore));
-1
votes

seems like dGrid doesn't take ObjectStore as its store.

try

fieldsStore = new Observable(new Memory({data}));

grid = new (declare([OnDemandGrid, DijitRegistry]))({
    store: fieldsStore
}, 'YOURGRIDDIV');

select = new Select({
    store: fieldsStore
}, 'YOURSELECTDIV');
select.startup();