ExtJS 4.2.2 form submit error

Monday, May 5, 2014

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


I used it on my previous extjs version and it works but in 4.2.2 there is an error.


Here is my Code using pop up window



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();






http://ift.tt/1htjD9P