Jacob
Jacob

Reputation: 4021

Dojo form.FilteringSelect store doesn't get filled immediately

I dynamically create a dojo.form.FilteringSelect component like this:

new dijit.form.FilteringSelect({
        id: 'form_resSelect',
        name: 'resSelect',
        store: store,
        style: {width: '250px'}
    }, resourceContainer );

I have noticed that the store gets filled only after clicking on the widget on the rendered form. Are there any properties that can fix this to be immediate or am I doing something wrong?

Upvotes: 0

Views: 66

Answers (1)

Craig Swing
Craig Swing

Reputation: 8162

Assuming the store is an ItemFileReadStore, you can call the _forceLoad function on the store.

var store = ...
store._forceLoad();

new dijit.form.FilteringSelect({
    id: 'form_resSelect',
    name: 'resSelect',
    store: store,
    style: {width: '250px'}
}, resourceContainer );

Upvotes: 1

Related Questions