PDA

View Full Version : [SOLVED] file Upload...



joshuabco
25 Feb 2009, 1:29 PM
Hi I want to write a window with a form with htmleditor, textbox, combobox... and fileupload control... and I don't know why appears two textbox about this control and two buttons (Browse button and control button) on fileupload control... here a formpanel code and a attachment.. thanks in advance:




fileUpload: true,
frame: true,
autoheight:true,
method: 'POST',
baseParams: { opcion: '5' },
labelAlign : 'top',
bodyStyle: 'padding:5x',
width: 600,
layout: 'form',
items: [nombreNuevoConcepto,
asuntoNuevoConcepto,
cmb_categorias,
{
xtype: 'fileuploadfield',
id: 'f_load',
emptyText: 'Select a file...',
fieldLabel: 'File',
name: 'photo',
buttonCfg: {
text: '',
iconCls: 'add'
}
}],
buttons: [{
text: 'Save and close',
handler: function(){
if(myform.getForm().isValid()){
myform.getForm().submit({
url: 'conceptosAjax.jsp',
waitMsg: 'Uploading files...',
success: function(fp, o){
Ext.MessageBox.alert('OK','upload file complete. Saving data now');
guardarConcepto();
}
});
}else{
Ext.MessageBox.alert('Error','Datos de formulario inválidos');
}
}
},{
text: 'Cancel',
handler: function(){ mywindow.destroy(); }
}]
});

12200

25 Feb 2009, 1:32 PM
did you include the CSS from the example?

joshuabco
25 Feb 2009, 1:48 PM
this css?
<link rel="stylesheet" type="text/css" href="../shared/examples.css" />

Where is? on Ext directory?

Thanks

dj
25 Feb 2009, 3:40 PM
No Jay probably means this CSS


/*
* Ext JS Library 2.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* [email protected]
*
* http://extjs.com/license
*/

/*
* FileUploadField component styles
*/
.x-form-file-wrap {
position: relative;
height: 22px;
}
.x-form-file-wrap .x-form-file {
position: absolute;
right: 0;
-moz-opacity: 0;
filter:alpha(opacity: 0);
opacity: 0;
z-index: 2;
height: 22px;
}
.x-form-file-wrap .x-form-file-btn {
position: absolute;
right: 0;
z-index: 1;
}
.x-form-file-wrap .x-form-file-text {
position: absolute;
left: 0;
z-index: 3;
color: #777;
}


...comes with the example fileuploadfield component (btw: not a core widget)

joshuabco
26 Feb 2009, 5:55 AM
Hi thanks to everybody for yours answers... but the css don't come with the example.. (I guess)... I jus copy css code to a file and link to a page an It's works fine...

PD.: how to change a thread title to add [SOLVED] ??

carol.ext
26 Feb 2009, 7:18 AM
... but the css don't come with the example.. (I guess)...

Take a look at the includes in file-upload.html, file-upload.css comes with the example :


<title>File Upload Field Example</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<script type="text/javascript" src="../../adapter/ext/ext-base.js"> </script>
<script type="text/javascript" src="../../ext-all-debug.js"> </script>

<link rel="stylesheet" type="text/css" href="file-upload.css"/>

<script type="text/javascript" src="FileUploadField.js"></script>
<script type="text/javascript" src="file-upload.js"></script>

mjlecomte
26 Feb 2009, 7:37 AM
PD.: how to change a thread title to add [SOLVED] ??
Edit your first post, go advanced, then you can change the title, manage attachments, etc.

26 Feb 2009, 8:03 AM
Hi thanks to everybody for yours answers... but the css don't come with the example.. (I guess)... I jus copy css code to a file and link to a page an It's works fine...

PD.: how to change a thread title to add [SOLVED] ??

where did you get the file upload example?? did you look there?

joshuabco
26 Feb 2009, 8:06 AM
yes... here http://extjs.com/deploy/dev/examples/form/file-upload.html

26 Feb 2009, 9:03 AM
you should be looking at your local installation of Ext JS.