PDA

View Full Version : populate combobox with JSON store data



dadofgage
25 Jun 2012, 12:35 PM
I am running into an issue trying to populate a combobox with data from a JSON store.

Here is my code:



var projectDropDown = new Ext.data.Store({
autoLoad: true,
url: 'dropdown.json',
storeId: 'projectDropDown',
idProperty: 'ProjectID',
fields: [ 'ProjectID', 'ProjectName' ]
});


when I go directly to my JSON in the browser, all the data is showing properly; and here is my code for the combobox:



xtype: 'combo',
id: 'ProjectName',
fieldLabel: 'Project Name',
valueField: 'ProjectID',
displayField: 'ProjectName',
store: projectDropDown,
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Select a Project...',
selectOnFocus:true

dadofgage
25 Jun 2012, 4:42 PM
okay, found answer in that it had nothing to do with this code, but the code that was generating the JSON output, changed it and everything worked as it should