PDA

View Full Version : Button is not displaying in fileField



innovista1
4 Dec 2013, 6:39 AM
Dear friends,

We have a requirement in ExtJS for uploading a file from browser but it is working fine as per our requirement. In addition I have used a button(name Attach) this is not showing as a button but it is showing label. please find the below code and attachment.

Please help me this is urgent requirement.

Regards,
PBASAM


items: [{
xtype: 'filefield',
minWidth: 90,
minHeight:25,
buttonOnly: true,
buttonText: 'Attach',

listeners:{
change :function(obj, container, pos )
{
alert(" change listerner >>>>>>>>>>>>>>>>>");
var form = Ext.getCmp('uploadingId').getForm();
if(form.isValid()){
form.submit({
url: '../../jsp/fileuploder/fileuploder.jsp'
// waitMsg: 'Uploading your photo...',
// success: function(fp, o) {
// Ext.Msg.alert('Success', 'Your photo "' + o.result.file + '" has been uploaded.');
// }
});
}

var temp=obj.getValue().split("\\");
alert(" temp >>>>>>>>"+temp);

var temdata=temp[temp.length-1];
alert(" temdata >>>>>>>>"+temdata);

alert(temdata);
gridPanelRef.getStore().loadData([[temdata, ]], true);
}
}

Farish
4 Dec 2013, 7:02 AM
please use CODE tags to include code in your posts. The following example works fine:


Ext.create('Ext.form.Panel', {
title: 'Upload a Photo',
width: 400,
bodyPadding: 10,
frame: true,
renderTo: Ext.getBody(),
items: [{
xtype: 'filefield',
minWidth: 90,
minHeight:25,
buttonOnly: true,
buttonText: 'Attach'
}]
});

your problem might be outside of the field and most likely in the container having the filefield.