我已经在 Extjs Classic 中完成了多个文件上传,现在我想在 Modern 工具包中实现它,但存在问题 没有 fileButton 字段 所以我正在使用文件字段,但我不确定如何从文件字段获取文件数据,这里是代码:
{
xtype: 'fieldset',
title: 'Attechments',
reference: 'attachmentfile',
padding: 10,
layout: {
type: 'vbox',
align: 'stretch'
},
defaults: {
labelWidth: 130
},
items: [
{
xtype: 'filefield',
text: 'Attach Files',
name: 'files',
listeners:{
change: 'onFileChange'
}
}
]
}
在 View Controller 中:
onFileChange: function (field, e, value) {
// how to get fileField data so that i can upload via ajax and attach //more files options
}
最佳答案
在 ExtJS 6 经典工具包中:
var file = filefield.fileInputEl.dom.files[0];
在 ExtJS 6 现代工具包中:
var file = filefield.getComponent().getFiles()[0];
经典演示here
现代演示 here
关于javascript - 多个文件上传 Extjs 6 现代工具包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43983713/