PDA

View Full Version : How to get fieldlabel of combo in javascript



shobhaaradhya
11 Feb 2013, 6:55 AM
Hi,

My script for combo in extjs is

{
xtype: 'combo',
fieldLabel: 'Select Country',
anchor: '39%',
allowBlank: true,
validateOnBlur: true,
name: 'Country',
listEmptyText: 'Please Select country',
emptyText: 'Please Select country',
selectOnFocus: false,
store: 'dcountry',
vtypeText: 'Please Select country',
resizable: true,
mode: 'local',
valueField: 'id',
displayField: 'description',
loadingText: 'Loading countries...',
forceSelection: true,
triggerAction: 'all',
labelStyle: 'width:160px',
hiddenName: 'Country',
hidden: true,
hideLabel: true,
id: 'cntry',

}

Here i am trying to hide or show the combo and the label based on some condition.

the code is

Ext.getCmp('cntry').hide();
Ext.getCmp('cntry').show();

this hides/shows only the combo but not the lablefield.

how can I get do this?

Thanks in advance,
Aradhya

sword-it
12 Feb 2013, 6:51 AM
Hi
You can wrap your combo into a container and show or hide your container according to your need.