Ext submit时报错 Failed to execute 'appendChild' on 'Node': The new child element is null.

来源:互联网 发布:淘宝v2是什么意思 编辑:程序博客网 时间:2024/05/17 06:48

文件上传,无法提交,总是报错

Uncaught NotFoundError: Failed to execute 'appendChild' on 'Node': The new child element is null. 

Ext的submit()执行错误,跟踪js代码发现有一个参数为null了,最后发现是文件录入框的类型填错了,ext无法正常解析。

错误代码:

  1. items : [ {  
  2.     xtype : 'textfield',  
  3.     inputType : 'file',  
  4.     ///id : ...  
  5. } ]  
xtype的类型填成这样不能提交上传的文件,

正确写法:

  1. items : [ {  
  2.     xtype : 'filefield',  
  3.     ///id : ...  
  4. } ]
这样ext就能正常提交表单了。

阅读全文
0 1