我的问题是:我需要支持选择本地镜像文件
以及预览服务器端图像
,我正在使用插件FileUploadField
。它有一个
从本地文件中选择的按钮,如何在它附近添加另一个按钮?
也许这是同一个问题:
如何找到按钮的父组件,并 append 另一个子组件(按钮)?
非常感谢。
最佳答案
您可以在像这样呈现字段后添加自定义按钮
Ext.onReady(function(){
var fp = new Ext.ux.form.FileUploadField({
renderTo : Ext.getBody(),
emptyText: 'Select an image',
listeners : {
afterrender : function(fupload) {
this.customButton = new Ext.Button({
renderTo : Ext.getBody(),
cls: 'x-form-file-btn',
text : 'some button'
});
this.customButton.el.insertAfter(fupload.fileInput);
}
}
});
});
例子:
关于extjs - 在 Extjs 3.3 中,如何在 'select file' 按钮附近添加另一个按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15857255/