PDA

View Full Version : populate combobox from database



paulvonline
8 Jun 2010, 3:43 AM
Hi

I want to populate the ExtJs combo box from database. For that I declared an array and was able to fill that array from database. But when I used that array as the store, I was not able to populate my combo box


code for combo box

{
xtype:'combo',
fieldLabel: 'Country',
store:country,
name: 'subcountry',
anchor:'95%'
}




code for populating the array


var country=new Array();
PatientAjaxDwr.fetchCountries(callback=function(list){
for(var i=0;i<list.length;i++){
country[i]=list[i];
}
alert(country);
});


but if i hard code that array I can populate the combobox

like

country=['UK', 'US','NETHERLANDS'];


please help



Thanks and Regards
Paul