PDA

View Full Version : Ext.form.field.File - Bring up file upload screen from function.



JamboBuenna
9 Mar 2012, 5:50 AM
Hello all,

I need to bring up the file upload screen provided by Ext.form.field.File from a function, however have been stuck on this for a while.

I presume my function needs to call that the same function used as when a user clicks on the browse button in the fileUploader, however I can't find the function to do this.

Any help would be much apreciated.


my.fileUploader = Ext.create('Ext.form.field.File', {


border: false,
buttonOnly: true,
xtype: 'filefield',
name: 'photo',
fieldLabel: 'Photo',
labelWidth: 200,
msgTarget: 'side',
allowBlank: false,
hideLabel: true,
anchor: '100%',
listeners: {
'change': function (button, value) {


my.submitFunction();
}
}




});

Unfortunately I can not see this in the documentation anywhere and have spent the last few hours searching the web for a solution.

Thanks in advance for any help.
James.

mitchellsimoens
9 Mar 2012, 11:02 AM
The browser imposes a limit to what you can do with a file input field.