【问题标题】:in Extjs 3.3, How to add another button near by the 'select file' button?在 Extjs 3.3 中,如何在“选择文件”按钮附近添加另一个按钮?
【发布时间】:2013-03-29 05:53:28
【问题描述】:

我的问题是:我需要支持select local image filespreview server side images,我正在使用插件FileUploadField。它有一个 从本地文件中选择的按钮,如何在它附近添加另一个按钮?

也许这是同一个问题:

如何找到一个按钮的父组件,并附加另一个子(按钮)?

非常感谢。

【问题讨论】:

    标签: extjs append


    【解决方案1】:

    您可以在像这样呈现字段后添加自定义按钮

    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-05
      • 2019-03-25
      • 1970-01-01
      • 2016-05-01
      • 2011-10-28
      • 2021-07-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多