Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ExtJS 4.2.2表单提交错误_Extjs_Extjs4.2 - Fatal编程技术网

ExtJS 4.2.2表单提交错误

ExtJS 4.2.2表单提交错误,extjs,extjs4.2,Extjs,Extjs4.2,未捕获NotFoundError:未能在“节点”上执行“appendChild”:新的子元素为null 我在以前的extjs版本中使用了它,但在4.2.2中出现了一个错误 这是我使用弹出窗口的代码 var win = Ext.create('Ext.window.Window',{ id: 'uploadContract1', title: 'Add/Replace Contract', //width: 450,

未捕获NotFoundError:未能在“节点”上执行“appendChild”:新的子元素为null

我在以前的extjs版本中使用了它,但在4.2.2中出现了一个错误

这是我使用弹出窗口的代码

var win = Ext.create('Ext.window.Window',{
            id: 'uploadContract1',
            title: 'Add/Replace Contract',
            //width: 450,
            //height: 350,
            //layout: 'fit',
            resizable: true,
            region: 'center',
            items: [
                {
                    xtype   : 'form',
                    title      : '',
                    url: '/users/update_contract/'+id,
                    id: 'contractForm',
                    //width      : 400,
                    //bodyPadding: 10,
                    //renderTo   : Ext.getBody(),
                    items: [{
                            xtype: 'fileupload',
                            text: 'Submit',
                            name: 'userfile',
                            vtype: 'vupload',
                            id: 'userfile',
                            fieldLabel: 'Contract',
                            msgTarget: 'side',
                            anchor: '100%',
                            buttonText: 'Select File...'
                            //multiple: true //multiupload (multiple attr)
                        }

                    ],
                    buttons: [{
                            text: 'Submit',
                            handler: function() {

                                var form = this.up('form').getForm();
                                console.log(form.isValid());
                                //alert(id);

                                if(form.isValid()){

                                    form.submit({

                                        waitMsg: 'Please wait...',
                                        success: function(fp, o) {

                                            Ext.getCmp('uploadContract1').close();
                                            store.load();
                                            Ext.Msg.alert('Success', 'Contract updated!');



                                        },
                                        failure: function(form, action) {
                                            Ext.Msg.alert('Failed', action.result ? action.result.message : 'No response');
                                        }
                                    });
                                }
                            }
                        }]
                }
            ]


    }).show();

我得到了答案,我将
xtype:'fileupload'
更改为
xtype:'filefield'