Skip to content

Instantly share code, notes, and snippets.

@pguerrant
Created November 14, 2013 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pguerrant/7474932 to your computer and use it in GitHub Desktop.
Save pguerrant/7474932 to your computer and use it in GitHub Desktop.
var states = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
]
});
// Create the combo box, attached to the states data store
var combo = Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
renderTo: Ext.getBody()
});
var text1 = Ext.widget({
xtype: 'textfield',
renderTo: document.body
});
var text2 = Ext.widget({
xtype: 'textfield',
renderTo: document.body
});
combo.on('blur', function() {
console.log('combo blurred');
});
text1.on('blur', function() {
console.log('text1 blurred');
});
combo.focus();
text1.focus();
text2.focus();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment