ExtJs4.2,文件上传,无法提交至指定URL

ExtJs4.2,文件上传,无法提交至指定URL。用浏览器调试JS,发现总报如下的错:
Uncaught NotFoundError: Failed to execute 'appendChild' on 'Node': The new child element is null.  
我的JS代码如下:
				items : [ {
					xtype : 'textfield',
					inputType : 'file',
					///id : ...
				} ]
继续用浏览器调试跟踪:
//ext-all-dev.js:124759L
  isFileUpload: function() {
        return this.inputType === 'file'; //返回true
    },

//ext-all-dev.js:121545L
        // Special handling for file upload fields: since browser security measures prevent setting
        // their values programatically, and prevent carrying their selected values over when cloning,
        // we have to move the actual field instances out of their components and into the form.
        len = uploadFields.length;


        for (i = 0; i < len; ++i) {
            el = uploadFields[i].extractFileInput(); //返回null
            formEl.appendChild(el); //报错:Uncaught NotFoundError
            uploadEls.push(el);
        }
        
//ext-all-dev.js:123915L
    extractFileInput: function() {
        return null;
    },        
    
经查,发现filefield的extractFileInput返回的不是null,所以,试着将上述的代码修改为:
				items : [ {
					xtype : 'filefield',
					///id : ...
				} ]
问题解决!
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值