PDA

View Full Version : fileuploadfield problem



ftopku
24 Jul 2009, 3:29 PM
Hello. I have problem - when i trying to create Tab with "fileuploadfield", i get en error in FireBug:

b[d.xtype || e] is not a constructorchrome://firebug/content/blank.gifExt.DomHelper=function(){var s=null,j=/^...b.stopEvent();this.completeEdit()}}}});\n
ext-all.js (line 7)Code:

function addDocTab(tTitle, tID) {
Ext.getCmp('mainTabPanel').add({
title: tTitle,
id: tID+'_tab',
bodyStyle: 'padding:5px 5px 0',
closable: true,
autoScroll: true,

items:[
new Ext.FormPanel({
fileUpload: true,
frame: true,
border: false,
items: [{
border: false,
layout: 'form',
items: [{
xtype:'textfield',
fieldLabel: '????????',
name: 'first',
anchor:'100%'
},{
border: false,
xtype: 'fileuploadfield',
id: 'form-file',
emptyText: 'Select an image',
fieldLabel: 'Photo',
name: 'photo-path',
buttonText: '',
buttonCfg: {
iconCls: 'upload-icon'
}
}]
},{
layout: 'column',
border: false,
items:[{
border: false,
columnWidth: .5,
layout: 'form',
items: [{
xtype: 'textfield',
fieldLabel: '????',
name: 'first',
anchor: '95%'
}]
},{
border: false,
columnWidth: .5,
layout: 'form',
items: [{
xtype: 'datefield',
fieldLabel: '????',
format: 'd.m.Y',
name: 'last',
anchor: '100%'
}]
}]
},{
xtype: 'htmleditor',
id: 'bio',
fieldLabel: 'Biography',
height: 300,
width: Ext.getCmp('mainTabPanel').getWidth() - 13
//anchor: '95%'
}],

buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
})
]
}).show();
}If delete xtype: 'fileuploadfield', all works.Is this bag or some mistake in my code?:-/ Would be grateful for any help.
P.S.: Sorry for my bad English. =/

ftopku
28 Jul 2009, 2:14 PM
If some one will have same problem - include FileUploadField.js file (examples/ux/FileUploadField.js).

VinylFox
28 Jul 2009, 7:00 PM
The key part in that error message was the reference to xtype...

b[d.xtype || e] is not a constructor

So what this is saying is "you told me to create a component that doesn't exist"

parsifal
29 Jul 2009, 12:35 PM
Why are these extensions housed in the examples directory? If we're meant to use them, they shouldn't be in there.

Animal
29 Jul 2009, 12:43 PM
You can't want to include every obscure widget that anyone, anywhere might have cause to use!