在afterrender方法中针对type是file的input框添加accept属性,控制显示图片、文本等文件类型
xtype:'filefield',
id:'fileUpload',
buttonText:'选择文件',
width:600,
fieldStyle:'background:#DDD',
listeners:{
afterrender:function(obj,ops){
$("#fileUpload input").attr("accept","image/*");
}
}
限制文件类型可参考:
https://blog.csdn.net/hanshileiai/article/details/44702923