PDA

View Full Version : this.dom is undefined on closing a window and on hover the closing button



flamant
8 Apr 2012, 7:27 AM
Hi,
I display windows when a field value (combo) is selected



var displayVisibilityImpact = new Ext.Window({
id: 'displayVisibilityImpactWinId_' + field.getId(),
layout:'fit',
renderTo: document.getElementsByTagName("body")[0],
width:400,
height:300,
minWidth: 300,
minHeight: 200,
plain: false,
autoScroll: true,
modal: true,
iconCls: 'warningMessage',
title: '<spring:message code="application.visibility.impact"/>',
items: {
xtype: 'displayfield',
hideLabel: true,
value: resultReport
},
buttons: [
{
id: 'displayVisibilityImpactOK',
text: '<spring:message code="action.OK"/>',
handler: function() {
Ext.getCmp('displayVisibilityImpactWinId_' + field.getId()).close();
}
}
],
listeners: {
afterrender: function(win) {
this.show();
}
}
});


For a combo selected value it displays 2 windows because the new value impact another field that also opens a window. The 2 windows are display one exactly on top of the other.

When I close the first window, I get the following error



this.dom is undefined
for the following line in ext-all.js
hasClass:function(F) {
return F && (" " + this.dom.className + " ").indexOf(" " + F + " ") != -1
}


Then I can see the second window and as soon as I hover on the closing button (without clicking on it) (and this button is exactly at the same position that the first window closing button), I get the same error

Thank you in advance for your answers

scottmartin
9 Apr 2012, 5:26 AM
If you change your render prop to the following, does it help?

renderTo: Ext.getBody() // or document.body

Regards,
Scott.

flamant
9 Apr 2012, 6:14 AM
Hi Scott and thank you for your answer,

Hi tried both solution without success

Thanks again

scottmartin
9 Apr 2012, 6:25 AM
Are you trying to constrain the window to another container? What if you just remove the renderTo since it is a window?

Regards,
Scott.

flamant
9 Apr 2012, 6:36 AM
Hi,
I removed the renderTo and I have exactly the same result



var displayVisibilityImpact = new Ext.Window({
id: 'displayVisibilityImpactWinId_' + field.getId(),
layout:'fit',
width:400,
height:300,
minWidth: 300,
minHeight: 200,
plain: false,
autoScroll: true,
modal: true,
iconCls: 'warningMessage',
title: '<spring:message code="application.visibility.impact"/>',
items: {
xtype: 'displayfield',
hideLabel: true,
value: resultReport
},
buttons: [
{
id: 'displayVisibilityImpactOK',
text: '<spring:message code="action.OK"/>',
handler: function() {
Ext.getCmp('displayVisibilityImpactWinId_' + field.getId()).close();
}
}
]

});
displayVisibilityImpact.show();