View Full Version : [Solved] LayoutDialog not closing properly [Ext-1.1]

6 Aug 2007, 1:24 AM
Hello everyone,

I've been trying to solve a very weird problem with EXT JS' LayoutDialog for quite some time now. Inside this dialog there's only one ContentPanel (in the center region), it contains the fullsize-version of an image.
Whenever the user closes the dialog and selects another image (from a different page which is loaded via AJAX) the dialog is resized, the panel's content is set to the new image, the dialog is centered and then finally shown.

And that's just where the problem lies: the dialog won't close properly. Well, not always that is.
The first time the close-button is clicked the close-animation plays, the dialog is still there, however. Clicking the close button (or the "X" in the top-right corner for that matter) will always just play the close-animation without actually closing the dialog.

However, if the dialog is dragged, no matter how far, the close button will correctly close everything. But only if the close button has been clicked before dragging at least once. Sounds weird, doesn't it?

I really don't know just what I am doing wrong, I've spent almost two days trying to figure out what is wrong here, to no avail.

Best see for yourself, I've uploaded the prototype to our development server, the URL is http://dev.rics.at/weird.

A few words of warning:
- This is only a prototype, I know the HTML and CSS is a tad messy
- The page's in german (Vienna, Austria here) - this shouldn't be much of a hindrance though since there's only one image to click per page ;)
- I'm not the one responsible for that layout - I know it doesn't meet any usability standards ;)
- I know that IE7 won't render the page at all because of some weird Javascript error in the nav-tree. I just didn't yet have time to fix that, heh

I tried using different adapters, I tried different style-combinations on the dialog's div (position: absolute/relative, visibility: hidden or display: block, ...), I tried different browsers, I believe I tried just about anything ;)

Thanks in advance for any help - and sorry if this has already been posted somewhere - I did search, using this board's search engine and google, I read the documentation, I read the tutorials... But as I said, to no avail :)

- Mike

6 Aug 2007, 2:03 AM
Okay, after all this testing, searching, debugging and whatnot I finally found the solution.

As soon as I set the LayoutDialog's element to Ext.id() and the autoCreate config option to true everything worked just fine.
The most complex problems always have the most simple solutions it seems. *shrugs*