-
23 Sep 2009 3:13 PM #1
File Uploader field disapear after second time being rendered
File Uploader field disapear after second time being rendered
Hi guys.
Im facing a weird problem while trying to build a form with FileUploader plugin.
Every time i get the form with this field opened it simply disapear.
The code is :
where form is my form.Code:var fileupload = new Ext.ux.form.FileUploadField({ id: 'form-file', width: 400, emptyText: 'Select a file', fieldLabel: 'File', name: 'file', buttonText: '', buttonCfg: { iconCls: 'upload-icon' } }); form.add(fileupload);
I dont perform any logic to enable or disable this field. It just disapear by itself at the second time i get the form opened.
Anyone knows what could be happening?
Thanks in advance.
-
27 Sep 2009 6:21 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,167
- Vote Rating
- 29
try adding: form.doLayout(); after form.add(fileupload);
You need to call doLayout to actually perform the DOM manipulation necessary.
I cover this stuff in the early chapters of Ext JS in Action: http://manning.com/garcia
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
28 Sep 2009 4:21 AM #3
Thanks jgarcia for the reply.
I've actually found the reason for this weird behavior.
When using fileuploader plugin it is necessary to give diferent ids to each instance that you put in your form (or diferent forms).
So.. i settled a static constant inside my class that get incremented and concatenated in the id value.
This action sort out my problem.
Ivan.


Reply With Quote