文件上传,无法提交,总是报错
Uncaught NotFoundError: Failed to execute 'appendChild' on 'Node': The new child element is null. 。
Ext的submit()执行错误,跟踪js代码发现有一个参数为null了,最后发现是文件录入框的类型填错了,ext无法正常解析。
错误代码:
- items : [ {
- xtype : 'textfield',
- inputType : 'file',
- ///id : ...
- } ]
正确写法:
- items : [ {
- xtype : 'filefield',
- ///id : ...
- } ]
本文解决了一个关于使用Ext框架进行文件上传时出现的问题。错误源于表单中文件输入字段配置不当,将 xtype 设置为了 'textfield' 并指定 inputType 为 'file',这导致 Ext 无法正确解析并提交文件。正确的做法是将 xtype 设置为 'filefield'。
3275

被折叠的 条评论
为什么被折叠?



