PDA

View Full Version : how to make invisible the file input field?



Marcelo Augusto
11 Feb 2015, 3:00 AM
51722

I want to take everywhere in red, leaving only the part marked in yellow.

Below is my code:


Ext.define('ExtMVC.view.ImageUpload',{
extend: 'Ext.window.Window',
alias: 'widget.imageupload',
width: 500,
frame: true,
title: 'Adicionar imagem',
autoShow: true,
modal: true,




defaults: {
anchor: '100%',
allowBlank: false,
msgTarget: 'side',
labelWidth: 50
},


items: [
{
xtype: 'form',
itemId: 'imageForm',
bodyPadding: '10',
items: [
{
xtype: 'filefield',
fieldLabel: 'Imagem',
emptyText: 'Selecione uma imagem',
name: 'arquivo',
buttonText: '',
buttonConfig: {
iconCls: 'icon-image'
}
}
]
}
],


dockedItems: [
{
xtype: 'toolbar',
dock: 'bottom',
layout: {
xtype: 'hbox',
pack: 'end'
},
items: [
{
xtype: 'button',
text: 'Salvar',
itemId: 'save',
iconCls: 'icon-save'
},
{
xtype: 'button',
text: 'Cancelar',
itemId: 'cancel',
iconCls: 'icon-reset'
}
]
}
]

});


Thank you in advance.

chamacs
11 Feb 2015, 12:15 PM
Did you try the buttonOnly config?
http://docs-origin.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.File-cfg-buttonOnly

Or the FileButton class?
http://docs-origin.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.FileButton

Marcelo Augusto
12 Feb 2015, 2:33 AM
With buttonOnly remains so. I could not implement the fileButton. Appeared to me this error:
Uncaught Error: [Ext.createByAlias] Can not create an instance of unrecognized alias: widget.fileButton

chamacs
12 Feb 2015, 5:42 AM
Xtype/alias should be all lower case

Marcelo Augusto
12 Feb 2015, 5:57 AM
Straightened, but still showing the upload field