I’m using Ext.Form.Panel successfully but I want to use Ext.form.field.File this time. I was able to submit and upload the data putting the field.file info a form.Panlen which I think is not the only option. For now I have:
Ext.create('Ext.form.field.File', {
id: 'ala-bala',
name: 'doc',
width: 300,
buttonOnly: true,
hideLabel: true,
listeners: {
'change': function(fb, v){
var el = Ext.getCmp('ala-bala-nica');
el.update('<b>Selected:</b> '+v);
which is part of my docked toolbar and I also have a button:
xtype:'button',
icon: g_settings.iconUrl + 'add-icon.png',
text: 'Add File',
// handler: this._addDocument
handler: function() {
var form = Ext.getCmp('ala-bala').getRawValue();
// if(form.isValid()){
form.submit({
}
}
obviously I can not use form.submit with this, but I hope there’s a way to keep my form.field.File and still be able to submit and upload my files. Just can’t figure it out.
Thanks
Leron
When I was dealing with the similar problem I was basically creating an dummy form and calling
submit()on this form. Something like this: