extjs - 在 Extjs 3.3 中,如何在 'select file' 按钮附近添加另一个按钮?

标签 extjs append

我的问题是:我需要支持选择本地镜像文件以及预览服务器端图像,我正在使用插件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);
            }
        }
    });
});

例子:

JSFiddle Link

关于extjs - 在 Extjs 3.3 中,如何在 'select file' 按钮附近添加另一个按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15857255/

相关文章:

css - Extjs 消息框居中对齐

extjs - 检查列全选;标题操作,选择所有功能

plugins - Extjs 4网格过滤

c# - 通过 jQuery .append() 添加 ASP.Net 元素

sencha-touch - Sencha Touch 中 doLayout() 和 doComponentLayout() 之间的区别?

javascript - 如何使用 Ext.iterate (或 JS)迭代对象数组?

jquery - 将字符串 append 到文本框内容?

python - 将字典 append 到循环中的列表

javascript - 将单词变成 jQuery 链接

带有列表和追加的 Python 奇怪行为