View Full Version : Combo box with Ext data store

7 Aug 2012, 10:43 AM
Hi ,

I am unable to load data from my data store. I am using it LOCALLY only, and not REMOTELY. I might bring data from remote location, but not right now. I am using MVC architecture for the app.

Here is my code snippet.


Ext.define('sample.store.USStates', {
extend : 'Ext.data.Store',
data : [['1', 'OR'], ['2', 'WA']],
triggerAction : 'all',
editable : true,
autoLoad : true


app/model/USState.js :

Ext.define('sample.model.USState', {
extend : 'Ext.data.Model',
fields : ['value', 'text']



Ext.define('sample.controller.XXXXXX', {
extend : 'Ext.app.Controller',

stores : ['USStates'],

models : ['USState']


new Ext.form.ComboBox({
fieldLabel : 'State Certificate',
store : 'USStates',
name : 'stateCertificate',
queryMode : 'local',
valueField : 'value',
displayField : 'text'

I get combo box in the form, but without any values displayed. What am I doing wrong ?

Tim Toady
7 Aug 2012, 11:16 AM
Your data isn't formatted correctly

Unless of course you were using an array store/reader (which you aren't). Also triggeraction and editable don't belong on your store but on your combo. You don't need to autoload with a store with inline data.

7 Aug 2012, 11:25 AM
Hi Tim,

Yes, It helps. Thanks a lot. :) But there is one more problem to it, I don't get my combo box values when I edit the record. What can be the problem ? :(

7 Aug 2012, 12:02 PM
Hi ,

I found my answer myself. I had used values which were not available in combo. Thanks for all your help.