PDA

View Full Version : Extjs combobox not displaying data properly



venkatesh045
9 Aug 2011, 10:00 AM
In my application, i do an Ajax request to retrieve data for a number of fields in my page. I then initialize the UI components and assign pieces of data to the appropriate UI fields. I have a combobox for which i assign a piece of data with the help of a JsonStore. The combobox fails to display such data. When i click the down arrow, i just see a loading message with a loading icon.. If i click on it though, the first item is getting selected.. If i use a Multiselect in its place, everything works great..

My code snippet looks something like this:



...
...

if (jsonStr.releaseMigrationList != null) {
updateRelease.releaseMigrationPathReleaseStore= new Ext.data.JsonStore({
storeId:"releaseMigrationPathStore",
root:"releaseList",
fields:['releaseNumberId', 'releaseNumber'],
data:jsonStr.releaseMigrationList,
autoLoad:true
});


updateRelease.releaseMigrationPathReleaseList = new Ext.form.ComboBox ({
name:'releaseMigrationReleaseList',
fieldLabel:'Release ',
store:updateRelease.releaseMigrationPathReleaseStore,
typeAhead:true,
forceSelection: true,
displayField:'releaseNumber',
valueField: 'releaseNumberId',
triggerAction: 'all',
emptyText:"select release",
listWidth:200,
selectOnFocus:true,
minListWidth:178,
renderTo:'migrReleaseList'
});


}


And my relevant piece of information for the input to this piece of code comes back from the server like this:

Note that i first get the data from the server and in the ajax callback function after the data is got, i execute the above mentioned code.. So, the data exists for sure when the above code is executed ..



...
....

"releaseMigrationList":
{"releaseList":
[{"releaseNumberId":"11","releaseNumber":"aaa"},
{"releaseNumberId":"22","releaseNumber":"bbb"},
{"releaseNumberId":"33","releaseNumber":"1ccc"}]
}
...
....



Could some one please explain what i am missing here.. I have been stuck in this problem for a while now..