PDA

View Full Version : How to prevent the submit of form from resetting a file field?



hongwenchina
20 Jun 2012, 7:00 PM
Hi all,

The file field of the form panel will be reset to empty value when invoking the submit method.
In my case,I need to keep the value of the file field ,who can help me?
Thanks a lot.

scottmartin
21 Jun 2012, 9:26 AM
Please review the following:
http://www.sencha.com/forum/showthread.php?223086

Scott.

hongwenchina
23 Jun 2012, 11:20 PM
Thank you ,i workaround it with the following code which could be found at http://www.sencha.com/forum/showthread.php?135109


(http://www.sencha.com/forum/showthread.php?135109)

Ext.form.field.File.override({
extractFileInput: function() {
var me = this,
fileInput = me.fileInputEl.dom,
clone = fileInput.cloneNode(true);

fileInput.parentNode.replaceChild(clone, fileInput);
me.fileInputEl = Ext.get(clone);
return fileInput;
}
});