PDA

View Full Version : [SOLVED] Ext.ux.UploadPanel layout problem...



danielbertini
14 Oct 2010, 6:36 AM
Hello, i need a help.
The uploadPanel does not appear in east region.



var navWest = new Ext.Panel({
title: 'Pastas',
region: 'west',
split: true,
layout: 'fit',
width: 220,
minSize: 220,
maxSize: 400,
collapsible: true,
margins: '5 0 5 5',
cmargins: '5 5 5 5',
items: [folders]
});

var navCenter = new Ext.Panel({
title: 'Arquivos',
region: 'center',
margins: '5 0 5 0',
cmargins: '5 5 5 5'
});

var navEast = new Ext.Panel({
title: 'Upload',
region: 'east',
split: true,
width: 220,
minSize: 220,
maxSize: 400,
collapsible: true,
margins: '5 5 5 0',
cmargins: '5 5 5 5',
layout:'fit',
xtype:'uploadpanel',
buttonsAt:'tbar',
id:'uppanel',
url:'save_data.php?scr=file_upload',
path:'root',
maxFileSize:1048576
//enableProgress:false,
//singleUpload:true,
});

var container = new Ext.Container({
layout: 'border',
items: [navWest,navCenter,navEast]
});

troseberry
14 Oct 2010, 6:49 AM
It appears your trying to assign a Ext.Panel with an "xtype" of 'uploadpanel'. Why not just create a "new Ext.ux.Uploadpanel" as the east region instead?

danielbertini
14 Oct 2010, 6:53 AM
Ok, changed to:



var navEast = new Ext.FormPanel({
title: 'Upload',
region: 'east',
split: true,
width: 220,
minSize: 220,
maxSize: 400,
collapsible: true,
margins: '5 5 5 0',
cmargins: '5 5 5 5',
items: [
new Ext.ux.UploadPanel({
layout: 'fit',
xtype: 'uploadpanel',
buttonsAt: 'tbar',
id: 'uppanel',
url: 'save_data.php?scr=file_upload',
path: 'root',
maxFileSize: 1048576
//enableProgress:false,
//singleUpload:true,
})
]
});


But i get the error:
this.buttonCt is null
http://localhost/resources/extjs/filetree/js/Ext.ux.form.BrowseButton.js
Line 151

troseberry
14 Oct 2010, 7:18 AM
Why have you overnested the UploadPanel? Have you tried something like this



var navEast = new Ext.ux.UploadPanel({
...
});

danielbertini
14 Oct 2010, 7:22 AM
Solved change this:
this.buttonCt = this.el.child('.x-btn-center em');

to this:
this.buttonCt = this.el.child('.x-btn-mc em');

on Ext.ux.form.BrowseButton renderer...