Created
February 11, 2012 08:53
-
-
Save digibutt/1798053 to your computer and use it in GitHub Desktop.
Hello World Ext Combo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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