surindersammy
27 Jun 2012, 9:31 PM
Hi,
I have one form with filefiled xtype. But its could not working. Its have so many problems,
When i submit form is not post correct form file field data.
Ext.define('Saas.view.Masters.Companies.Form.CompaniesForm', {extend : 'Ext.form.Panel',
alias : 'widget.CompaniesForm',
id : 'CompaniesAddForm',
method : 'POST',
enctype:'multipart/form-data',
fileUpload: true,
isUpload: true,
initComponent: function (arguments) {
var me = this;
Ext.apply(me, {
autoHeight : true,
width : 920,
bodyPadding : 5,
items: [{
xtype: 'filefield',
name: 'logo_name',
fieldLabel: 'Photo',
labelWidth: 50,
msgTarget: 'side',
allowBlank: false,
anchor: '100%',
buttonText: 'Select Photo...',
listeners : {
change: function(btn, name, eOpts) {
Ext.getCmp('companyLogo').setSrc(this.getValue()) ;
}
}
},{
xtype : 'button',
text: 'Upload',
handler: function() {
var form = this.up('form').getForm();
if(form.isValid()){
form.submit({
url: 'photo-upload.php',
waitMsg: 'Uploading your photo...',
success: function(fp, o) {
Ext.Msg.alert('Success', 'Your photo "' + o.result.file + '" has been uploaded.');
}
});
}
}
}]
});
me.callParent(arguments);
}
});
Thanks,
I have one form with filefiled xtype. But its could not working. Its have so many problems,
When i submit form is not post correct form file field data.
Ext.define('Saas.view.Masters.Companies.Form.CompaniesForm', {extend : 'Ext.form.Panel',
alias : 'widget.CompaniesForm',
id : 'CompaniesAddForm',
method : 'POST',
enctype:'multipart/form-data',
fileUpload: true,
isUpload: true,
initComponent: function (arguments) {
var me = this;
Ext.apply(me, {
autoHeight : true,
width : 920,
bodyPadding : 5,
items: [{
xtype: 'filefield',
name: 'logo_name',
fieldLabel: 'Photo',
labelWidth: 50,
msgTarget: 'side',
allowBlank: false,
anchor: '100%',
buttonText: 'Select Photo...',
listeners : {
change: function(btn, name, eOpts) {
Ext.getCmp('companyLogo').setSrc(this.getValue()) ;
}
}
},{
xtype : 'button',
text: 'Upload',
handler: function() {
var form = this.up('form').getForm();
if(form.isValid()){
form.submit({
url: 'photo-upload.php',
waitMsg: 'Uploading your photo...',
success: function(fp, o) {
Ext.Msg.alert('Success', 'Your photo "' + o.result.file + '" has been uploaded.');
}
});
}
}
}]
});
me.callParent(arguments);
}
});
Thanks,