fileuploadfield extjs组件中的Cls/class值

fileuploadfield extjs组件中的Cls/class值,extjs,extjs4.2,Extjs,Extjs4.2,我们的测试自动化团队需要在我们正在使用的fileuploadfield组件中使用HTML类/cls值 下面是我们如何使用它。我在下面的代码中为cls输入了一个值,但它不见踪影 flex: 1, xtype: 'fileuploadfield', itemId: 'fileupload-field', anchor: '100%', textfieldWidth: 40, emptyText: 'Select a document to upload...', buttonText: 'Brows

我们的测试自动化团队需要在我们正在使用的fileuploadfield组件中使用HTML类/cls值

下面是我们如何使用它。我在下面的代码中为cls输入了一个值,但它不见踪影

flex: 1,
xtype: 'fileuploadfield',
itemId: 'fileupload-field',
anchor: '100%',
textfieldWidth: 40,
emptyText: 'Select a document to upload...',
buttonText: 'Browse ',
cls: 'file-upload', //??

listeners: { //chop out directory string
    change: function(fld, value) {
        var newValue = value.replace(/C:\\fakepath\\/g, '');
        fld.setRawValue(newValue);
    }
}
如何在文本字段和该组件上的按钮上获取cls值


更新:我在HTML表中找到了该组件的“文件上载”。我所需要的只是按钮和文本字段上的cls值。

我认为您可以使用文件字段的几个配置参数。请检查一下

{
            xtype: 'filefield',
            name: 'photo',
            fieldCls:'YourTextFieldClass',//Your textfield class
            fieldLabel: 'Photo',
            labelWidth: 50,
            msgTarget: 'side',
            allowBlank: false,
            anchor: '100%',
            buttonConfig:{
            text:'Your button', 
            cls:'buttonclass'//Your button class
          }

        }

有关更多信息,请查看文档。希望它能帮助您。

fieldCls适用于textfield,但cls不适用于按钮。但我使用的是“fileuploadfield”而不是“filefield”。所以也许这就是区别:)@OliverWatkins两者都是相同的。我验证了我能够看到我添加的类。{text:'Uplaod File',cls:'uploadbuttoncls',class=“x-btn uploadbuttoncls x-form-File-btn x-btn-default-small x-noicon x-btn-noicon x-btn-noicon x-btn-default-small-noicon”