PDA

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



mypen
26 Jan 2011, 7:57 PM
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

mypen
31 Jan 2011, 2:16 AM
Anyone has idea ..?? please help me