PDA

View Full Version : Ext.ux.form is undefined



chuvinha
21 Dec 2010, 11:37 AM
Hi guys, I am not to use the upload.
I put these lines in the jsp:
<link rel="stylesheet" type="text/css" href="js/ext-3.1/examples/ux/fileuploadfield/css/fileuploadfield.css" />
<script type="text/javascript" src="js/ext-3.1/examples/ux/fileuploadfield/FileUploadField.js"></script>

My code:



Ext.onReady(function() {


var fieldArquivo = new Ext.ux.form.FileUploadField( {
fieldLabel : 'Arquivo',
name : 'arquivo_upload',
id : 'form-file',
allowBlank : false,
anchor : '100%'
});


// form

var form = new Ext.form.FormPanel( {
id : 'formArquivo',
renderTo : 'uploadDaGaleria',
fileUpload : true,
monitorValid : true,
// @@MODIFY
items : [ fieldCodigo, fieldComplemento, fieldArquivo ],
buttons : [ btnCancelar, btnSalvar ]
});

});


And it appears the error:
Ext.ux.form is undefined

var fieldArquivo = new Ext.ux.form.FileUploadField( {

I already checked and the path is rigth.
Does anyone know why it isn't recognizing the Ext.ux.form.FileUploadField?

mitchellsimoens
21 Dec 2010, 1:54 PM
You are sure the script is being loaded?

chuvinha
22 Dec 2010, 4:11 AM
I put one alert in FileUploadField and this alert appears in the browser.
So the script is loaded.
But the error still continue.
My code:





<html>
<head>

<!-- Inicio CSS -->
<link rel="stylesheet" type="text/css" href="js/ext-3.1/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="js/ext-3.1/examples/shared/examples.css" />
<link rel="stylesheet" type="text/css" href="js/ext-3.1/examples/ux/fileuploadfield/css/fileuploadfield.css" />

<!-- Início da biblioteca EXTjs -->
<script type="text/javascript" src="js/ext-3.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="js/ext-3.1/ext-all.js"></script>
<script type="text/javascript" src="js/ext-3.1/examples/ux/fileuploadfield/FileUploadField.js"></script>

<!-- file upload form -->
<script src="js/uploadDeArquivos/formPanelPopupArquivo.js"></script>
</head>
<body>
<div id="uploadDaGaleria"></div>
</body>
</html>





Ext.onReady(function() {
var btnCancelar = new Ext.Button( {
text : 'Cancelar'
});

var btnSalvar = new Ext.Button( {
text : 'Salvar'
});

// Fields
var fieldCodigo = new Ext.form.TextField( {
fieldLabel : 'Codigo',
disabled : true,
name : 'codigo',
anchor : '100%'
});

var fieldArquivo = new Ext.ux.form.FileUploadField({
fieldLabel : 'Arquivo',
name : 'arquivo_upload',
id: 'form-file',
allowBlank:true,
anchor : '100%'
});

var fieldComplemento = new Ext.form.TextField( {
fieldLabel : 'Complemento',
name : 'complemento',
allowBlank : true,
anchor : '100%'
});

// form

var form = new Ext.form.FormPanel( {
id : 'formArquivo',
renderTo : 'uploadDaGaleria',
fileUpload : true,
monitorValid : true,
items : [ fieldCodigo, fieldArquivo, fieldComplemento],
buttons : [ btnCancelar, btnSalvar ]
});

});


I don't understand.
Could someone help me?

chuvinha
22 Dec 2010, 9:06 AM
Are only these scripts or I still need of more one?