I am having a form variable passed to my window and the records are populated from the grid/store. Following is the code:
{
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex){
var rec=grid.getStore().getAt(rowIndex);
var edit_app=Ext.create('Ext.Window',{
title: 'Edit Applicant: ' + rec.ge('app_name'),
items:[app_form],
buttons:[{
text: 'Update',
handler:function(){
if(edit_app.down('form').getForm().isValid()){ //or app_form.getForm().isValid(
edit_app.down('form').getForm().submit({
url: 'api/api.php',
waitMsg: '..submitting',
success: function(form,actns){
edit_app.hide();
},
failure: function(fomr,actnz){
alert('Error with submission');
edit_app.close();
}
});
}
}
}, {
text: 'Close',
handler: function(){
edit_app.hide();
}
}]
}).show();
var form = edit_app.down('form').getForm(); //app_form.getForm()
form.loadRecord(rec);
}
}
When I poulate the form the first time, it submits updates just fine.However, when I try the same operation the second time, I get the following messsage:
me.getRenderTarget(…).dom is undefined
targetNodes = me.getRenderTarget().dom.childNodes,
I have been trying googling the solution but no success till now.
Help will be highly appreciated
I believe the issue may be that you’re using “Ext.create” to build a new window object, each time the handler is called, and passing in the form as a variable reference, and using “hide” and “close” when you’re finished with the form. That can cause a lot of conflicts as Ext tries to access the original object, and finds no child objects, which is what your error looks like. The form could still be associated with the original object, or your window selector could be getting the original window, that now no longer has the form. Either way, Ext’s selectors are confused.
To test that out, try moving the Window create outside of the handler, and call “myWindow.show()” and your form population code.