PDA

View Full Version : Dialog shows up blurred



ntulip
24 May 2007, 9:49 AM
I have a dialog which loads up correctly the first time from a link inside a grid. When clicking on another link to reload the same dialog window, the dialog shows up as part of the parent window under the blurred overlay (as seen attached).

Any ideas what could be causing this.

The divs are immediately under the body tag.

tryanDLS
24 May 2007, 10:15 AM
When you open the 2nd time, are you reusing the previous dialog instance or re-creating? If you're recreating, did you remove the old dom node?

ntulip
24 May 2007, 10:22 AM
When you open the 2nd time, are you reusing the previous dialog instance or re-creating? If you're recreating, did you remove the old dom node?

Well -- I call "MyClass.showDialog(val,val1);" for which the code is below. Also - I just noticed the dialog is a global variable. I wonder if that's it.



showDialog : function(itemId,view){
// modal the dialog
Ext.get(document.body, true).toggleClass('ytheme-gray');
// create and initialize the dialog
if(!dialog){
var dialog = new Ext.BasicDialog('viewLeadsBy-dlg', {
height: 400,
width: 600,
minHeight: 100,
minWidth: 100,
modal: true,
proxyDrag: true,
shadow: true
});
dialog.addKeyListener(27, dialog.hide, dialog);
dialog.addButton('OK', dialog.hide, dialog);
dialog.addButton('Cancel', dialog.hide, dialog);

}

var showBtn = Ext.get('show-dialog-btn');
dialog.show(showBtn.dom);

removeDialog : function(){
dialog=null;
}

ntulip
24 May 2007, 10:22 AM
And no - I am not removing the old dom node. Are we talking about the viewLeadsBy-dlg div?

tryanDLS
24 May 2007, 11:07 AM
You're declaring a dialog var local to the func - it will always be null the next time thru. Subsequently, you will be adding a new node to the dom each time thru. Look at how the examples declare the dialog var so you get the correct scope - it needs to be at the object level, not function level.

ntulip
24 May 2007, 12:52 PM
=D>