Skip to content

Instantly share code, notes, and snippets.

@digibutt
Created February 11, 2012 08:53
Show Gist options
  • Save digibutt/1798053 to your computer and use it in GitHub Desktop.
Save digibutt/1798053 to your computer and use it in GitHub Desktop.
Hello World Ext Combo
Ext.onReady(function(){
var helloWorld = new Ext.form.Label({
text: 'Pick a country to say Hello to!'
,renderTo: 'page'
});
var dropdown = new Ext.form.ComboBox({
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'place',
'displayText'
],
data: [['America', 'Ni Hao Mei Guo!'], ['China', 'Ni Hao Zhong Guo!'],['England', 'Ni Hao Ying Guo!'], ['Hong Kong', 'Ni Hao Xiang Gang!']]
})
,mode: 'local'
,valueField: 'displayText'
,displayField: 'place'
,listeners: {
select: function(comboBox,record,index){
helloWorld.setText(comboBox.getValue());
}
}
,renderTo: 'page'
,editable: false
,triggerAction: 'all'
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment