PDA

View Full Version : upload file with api extdirect error



maneljn
4 Sep 2012, 5:55 AM
i have this error after submit uploaded file



TypeError: b.getComputedStyle(d.firstChild.firstChild, null) is null


The form


// Formulario para subir la foto
xtype: 'form',
name: 'formularioSubirFoto',
title: '',
bodyPadding: 5,
border: false,
anchor: '100%',
api: {
load: Ext.emptyFn,
submit: Ext.esicontactosDirect.esicontactos_contactos.subirFotoContacto
},
items: [{
xtype: 'filefield',
name: 'fotocontacto',
fieldLabel: gt.dgettext('esicontactos','Foto'),
labelWidth: 50,
msgTarget: 'side',
allowBlank: true,
anchor: '100%',
buttonOnly: false,
buttonText: gt.dgettext('esicontactos','Seleccione una imagen...')
}]


The submit action in mvc controller


// Ejecutar el submit de este formulario con extdirect
formularioSubirFoto.getForm().submit({
method: 'POST',
params: {
cto_id: cto_id,
cto_guid: cto_guid
},
success: function(form, action) {
console.log("success");
},
failure: function(form, action) {
console.log("failure");
}
});

mitchellsimoens
17 Sep 2012, 6:40 AM
And when do you get this error?

maneljn
17 Sep 2012, 7:23 AM
mitchellsimoens (http://www.sencha.com/forum/member.php?22216-mitchellsimoens), i have changed the source code and take another workarround, and now there is no error.

Manel