源代码如下:keel.UploadPanel.superclass.constructor.call(this,{
 tbar : [
{text:'添加文件',iconCls:'add',ref:'../addBtn'},'-',
{text:'上传',ref:'../uploadBtn',iconCls:'arrow_up',handler:this.startUpload,scope:this},'-',
{text:'停止上传',ref:'../stopBtn',iconCls:'delete',handler:this.stopUpload,scope:this,disabled:true},'-',
{text:'清空所有',ref:'../deleteBtn',iconCls:'newspaper_delete',handler:this.deleteAll,scope:this},'-'
],
layout : 'fit',
items : [this.gp],
listeners : {
'afterrender':function(){
var em = this.getTopToolbar().get(0).el.child('em');
var placeHolderId = Ext.id();
em.setStyle({
position : 'relative',
display : 'block'
});
em.createChild({
tag : 'div',
id : placeHolderId
});
alert(em);
this.swfupload = new SWFUpload(Ext.apply(this.setting,{
button_width : em.getWidth(),
button_height : em.getHeight(),
button_placeholder_id :placeHolderId
}));
this.swfupload.uploadStopped = false;
Ext.get(this.swfupload.movieName).setStyle({
position : 'absolute',
top : 0,
left : 0
});
alert(this.getTopToolbar().get(0).text);//此处拿到"添加文件"的按钮
this.getTopToolbar().get(0).click();//这里显示错误this.getTopToolbar().get(0).click is not a function
},
scope : this,
delay : 100
}
});要求如下:我在上一个页面点击“上传”时直接弹出文件选择框,而不是点击“上传”后,跳入一个页面,再点击”添加文件“按钮,才可以选择文件
以前的操作步骤,点击“上传”--》点击子窗口“添加文件”--》弹出文件选择框
现在的需求:点击上传---》弹出子窗口的同时加载出文件选择对话框
请问大家如何拿到“添加文件”按钮的点击事件呢?谢谢了