JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://dev.sencha.com/deploy/ext-4.0.2a/resources/css/ext-all.css">
JavaScript
// The data store containing the list of states
var names = Ext.create('Ext.data.Store', {
fields: ['id','FirstName', 'LastName'],
data : [
{'id':0,"FirstName":"Adam", "LastName":"Smith"},
{'id':1,"FirstName":"John", "LastName":"Alcatraz"},
{'id':2,"FirstName":"Nasha", "LastName":"Cartoga"}
//...
],
remoteFilter:true,
remoteSort:true
});
// Create the combo box, attached to the states data store
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose Name',
store: names,
id: 'nameCombo',
queryMode: 'local',
displayField: 'FirstName',
valueField: 'FirstName',
displayTpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'<tpl if="FirstName">',
'{FirstName}',
'</tpl>',
' ',
'<tpl if="LastName">',
'{LastName}',
'</tpl>',
'</tpl>'),
listeners: {
expand: {
fn: function(){
names.clearFilter(true);
names.filter('id', 1);
}
}
},
renderTo: Ext.getBody()
});
// Create the combo box, attached to the states data store
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose Name',
store: names,
id: 'nameCombo2',
queryMode: 'local',
displayField: 'FirstName',
valueField: 'FirstName',
displayTpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'<tpl if="FirstName">',
'{FirstName}',
'</tpl>',
' ',
'<tpl if="LastName">',
'{LastName}',
'</tpl>',
'</tpl>'),
listeners: {
expand: {
fn: function(){
names.clearFilter(true);
names.filter('id', 2);
}
}
},
renderTo: Ext.getBody()
});