PDA

View Full Version : EXT COMBO



vcsred
24 Nov 2011, 11:56 PM
Hai i am getting problem with ext combo box

Problem : When i assigned same values for valueField,i am not able to select displayField

skirtle
25 Nov 2011, 1:48 AM
Which ExtJS version?

From the description you've given it's impossible to help you. Please include some code and a full description of the problem you're having.

vcsred
30 Nov 2011, 2:55 AM
var fieldCombo = new Ext.form.ComboBox({
id: 'fieldNameCombo,
name: 'columnName',
typeAhead: false,
displayField:'GRPBYNAME',
valueField:'GRPBYID',
queryMode:'local',
width:140,
allowBlank: false,
emptyText: 'Select search field',
renderTo: 'fieldNameBox',
store:{
xtype:'Store',
fields:[
{
type:'string',
name:'GRPBYID'
},
{
type:'string',
name:'GRPBYNAME'
}
],
data:[
{
'GRPBYID':'TEXT',
'GRPBYNAME':'Name'
},
{
'GRPBYID':'TEXT',
'GRPBYNAME':'Address'
},
{
'GRPBYID':'DATE',
'GRPBYNAME':'Date'
},
{
'GRPBYID':'NUMBER',
'GRPBYNAME':'Number'
},
{
'GRPBYID':'DATE',
'GRPBYNAME':'Time'
}
]
}
});

I have the above code,In that code i assigned GRPBYID as the value field. The data which comes from server has same GRPBYID value for different display names.The problem is that when i try to select different display name with same value combo box is not selecting the new display field.

Please suggest if there is any mistake in the code.

skirtle
30 Nov 2011, 4:35 AM
You can't have the value in your valueField repeated across multiple records. It has to be unique within that store.