1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
var simpleCombo = Ext.create('Ext.form.field.ComboBox', {
fieldLabel: 'Select a single state',
displayField: 'name',
valueField: 'abbr',
width: 320,
labelWidth: 130,
queryMode: 'local',
typeAhead: true,
minChars: 2,
name: 'agentDownline',
store: new Ext.data.SimpleStore({
fields: ['abbr', 'name', 'slogan'],
data: [
['VA', 'Virginia', 'Mother of States'],
['WA', 'Washington', 'Green Tree State'],
['WV', 'West Virginia', 'Mountain State'],
['WI', 'Wisconsin', 'America\'s Dairyland'],
['WY', 'Wyoming', 'Like No Place on Earth']
]
}),
listeners: {
buffer: 50,
change: function() {
var store = this.store;
//store.suspendEvents();
store.clearFilter();
//store.resumeEvents();
store.filter({
property: 'name',
anyMatch: true,
value : this.getValue()
});
}
} |
Partager