PDA

View Full Version : problem with combo box selection



santoshsatav
7 Oct 2010, 1:44 AM
i have combobox on page loaded through store on focus event, but whenever i select new item fist item get shown as selected even if you select different item, i am not able to find solution on this
here is code


xtype: 'combo',
id: 'CList',
width:350,
emptyText: 'Select .',
allowBlank: true,
triggerAction: 'all',
typeAheadDelay: 500,
selectOnFocus:true,
lazyRender: true,
mode: 'local',
loadingText: 'Loading ..Please wait...',
editable: false,
store: {
xtype: 'groupingstore',
autoLoad: false,
reader: new Ext.data.JsonReader({
root: 'data',
fields: [
{
name: 'ID',
type: 'string'
},
{
name: 'Name',
type: 'string'
}
]
}),

groupField: 'ID'

},
valueField: 'ID',
displayField: 'Name',
minChars : 2,
listeners: {
'focus': function()
{
strAction = 'getClassList';
callids({webservice call });
}
}





loading code
Ext.getCmp('CList').store.loadData(response from webservice);

troseberry
7 Oct 2010, 5:52 AM
Could be caused from using the focus event. try just loading the combo's store a different way

santoshsatav
11 Oct 2010, 11:05 PM
dose any body have solution to this problem ?

Condor
12 Oct 2010, 1:44 AM
Your server is probably not returning unique ids in the combobox data.