PDA

View Full Version : Combo Box Labels



akshay2323
27 Jan 2013, 10:44 PM
Hi All,
I am using Extjs combo box in my project . And i am having an issue,like on clicking the label also the combo box gets expanded . Anyone having any idea why it is happening and how it can be rectified????

Regards,
Akshay

scottmartin
28 Jan 2013, 11:43 AM
I do not see this .. what version of Ext4 are you using?

from the API example:


// The data store containing the list of states
var states = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AL", "name":"Alabama"},
{"abbr":"AK", "name":"Alaska"},
{"abbr":"AZ", "name":"Arizona"}
//...
]
});

// Create the combo box, attached to the states data store
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
renderTo: Ext.getBody()
});


The combo is affected on click, but it does not expand.

Scott.

rupamkhaitan
9 Apr 2013, 2:08 AM
Hi

I load my combo box with local store once its created.
For example country_code json looks like



{
"success": "true",
"root": [
{
"country_code": "ae",
"name": "United Arab Emirates-ae"
},
{
"country_code": "ai",
"name": "Anguilla-ai"
}
]
}



My combo box component looks



xtype : 'combo',
itemId : 'countryCodeCombo',
labelAlign : 'left',
fieldLabel : 'Country Code',
width : 250,
displayField : 'name',
valueField : 'country_code',
store : 'configuration.CountryCodeStore',
name : 'country_code',
emptyText : 'Select a Country',
allowBlank : false,
queryMode : 'local',
minChars : 2,
typeAhead : true,
typeAheadDelay : 100,
colspan : 1


Now my server will return me country_code=ae , so accordingly UI should display United Arab Emirates-ae

But when i say form.loadRecords(records) , it shows me only ae in my combo box.

Please help

rupamkhaitan
9 Apr 2013, 2:12 AM
When i will select some other value in combo, it will show the name in UI, but will send the valueField to backend with code and not complete name.

Please help on this as well