PDA

View Full Version : Sort a combobox



Capi666
2 Apr 2008, 11:23 PM
Hi, how can sort a combobox... I see a method, but i can

devnull
3 Apr 2008, 9:00 AM
you sort the store, not the combo itself.
Either by providing a sortInfo in the store config, or calling its sort method later.

Capi666
8 Apr 2008, 1:57 AM
How can sort the store of combobox?



items:[{
xtype:'combo',
store: storeSer,
fieldLabel:'Ser.',
name:'ser',
id:'ser',
displayField:'desc',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
selectOnFocus:true,
valueField:"prodh",
anchor: '90%',
listeners : {
change: function(f,n,o) {
var rgfilterSerie = new RegExp(f.getValue);
Ext.getCmp('mod').store.filterBy(function(record) {
return record && rgfilterSerie.test(record.get('prodh'));
});
}
}


Thanks,

devnull
8 Apr 2008, 3:37 PM
the 'sort' method maybe? it's all right there in the API docs...