PDA

View Full Version : avoid repitions in combobox



shiva-Kumar
2 Feb 2010, 1:44 AM
Hi,

I have a combobox in which user can type and get the matched record filtered out from the store associated , but the problem is am seeing the repetitions as shown in the attachment.

can anyone please advise as how to avoid these reptitions.

code is as follows


exchCombo = Ext.extend(Ext.form.ComboBox,{
border: false,
frame:false,
hideLabel:true,
anchor:'95%',
mode: 'local',
typeAhead: true,
anyMatch: true,
queryIgnoreCase: true,
matchWordStart: false,
lazyRender:true,
store: exchangeStore,
displayField:'fullExchName',
valueField: 'record',
triggerAction: 'all',
selectOnFocus:true,
fieldLabel : 'GROUPList',
emptyText : 'Exchange',
valueNotFoundText:'Exchange',
editable:true
,onRender:function() {
futuresCombo.superclass.onRender.apply(this, arguments);
if(objExchange != null){
this.setValue(objExchange);
}
MessageBus.on('message', this.onMessage, this);
}
,onMessage:function(message, data) {
if(MessageType.exchangeSelected == message){
this.setValue(data);
}
}
,listeners: {
select: function(combo, record, index){
objExchange = record.exch;
fire2Bus(MessageType.exchangeSelected, objExchange);
}
,afterrender: function(c){
c.wrap.applyStyles('padding-bottom:3px');
}
}
});

realjax
2 Feb 2010, 1:47 AM
Change the store so it has only distinct values?

shiva-Kumar
2 Feb 2010, 2:18 AM
i have store which has absolutely distinct values plz see attachment

realjax
2 Feb 2010, 2:25 AM
I see. Looks like some sort of bug, try starting with a combobox that has a minimum of options configured. Maybe you can eliminate the bad guy this way.

shiva-Kumar
2 Feb 2010, 5:10 AM
well tried this but no results any other way of avoiding repetitions please.