PDA

View Full Version : How to disable file upload field and file upload icon



mypen
25 Jan 2011, 4:04 AM
How to disable file upload field and file upload icon on click on radio button NO ,it disables only file upload field and keep enable the icon,it dosen't hide file upload field icon

this is the code i am using

{
xtype: 'radiogroup',
fieldLabel: 'Documents Enclosed',
items: [
{boxLabel: 'Yes', id:'enc1', name: 'rb-auto', inputValue: 1, checked: true},
{boxLabel: 'No', id:'enc2', name: 'rb-auto', inputValue: 0}
],
listeners:{
change: function(radiogroup,radio)
{
var te=Ext.getCmp('enc1').getValue();
if(te==true )
{
Ext.getCmp('file1').setValue('');
Ext.getCmp('file1').setDisabled(false);
Ext.getCmp('file_upload').Visible(true);
}
else
{
Ext.getCmp('file1').setValue('NA');
Ext.getCmp('file1').setDisabled(true);
Ext.getCmp('file_upload').Visible(false); // this makes file upload icon invisible but when i click on
//that invisible icon it opens file upload window
}
}
}
}
{
xtype: 'fileuploadfield',
id: 'file1',
fieldLabel: 'Upload Document',
style: 'text-align: left',
buttonText: '',
allowBlank: false,
width: 135,
buttonCfg: {
iconCls: 'upload-icon',
id:'file_upload'
}
}

is there any way to remove the icon dynamically on click of radio button NO

Any help is greatly appreciated

Thanks A lot

AndreaCammarata
25 Jan 2011, 8:39 AM
Hi mypen.
You are posting in the wrong place.
This is Sencha Touch form, you have to post inside Ext Help forum to get what you ask for.

sikander singh
26 Jan 2011, 1:02 AM
Where is ext help forum ?

AndreaCammarata
26 Jan 2011, 1:04 AM
Follow this link
http://www.sencha.com/forum/forumdisplay.php?40-Ext-Help