首次使用后,ExtJs文件字段消失

时间:2014-07-01 10:13:25

标签: javascript extjs filefield

我尝试使用ExtJs文件字段控件上传文件。

我按如下方式使用它:

 xtype: 'container',
        margin: '15 0 0 25',
        layout: 'vbox',
        defaults: {
            width: 400
        },
        items: [{
            xtype: 'filefield',
            itemId: 'fileChooser',
            fieldLabel: 'CSV file',
            labelWidth: 50,
            buttonText: 'Select CSV file...'
       }]

但是,在我用它来选择一个文件(我设法做得正确)后,字段文件消失了!

有人遇到同样的问题吗?

1 个答案:

答案 0 :(得分:-1)

请以这种方式试试

                            {
                              xtype: 'form',
                              type: 'fileUploadForm',
                              items: [{
                                xtype: 'filefield',
                                cls:'upload-btn',
                                height:40,
                                type:'uploadButton',
                                name: 'file',
                                buttonText:'Upload New Version',
                            listeners: {
                                scope: this,
                                change: this.handleIconChange
                            }
                        }]
                        }