ext:Window position
*NEW - Coolite Toolkit Version 0.7 now available for DOWNLOAD. See also Examples Explorer.
 

Coolite Forums

Welcome Guest ( Login | Register )
 
ext:Window position
Subscribe
Last Login: 12/28/2008 11:07:32 PM
Posts: 52,
Posted 7/28/2008 12:26:42 PM

Group: Coolite Early Adopter

I have an ext:Window on my page, which is not displayed on PageLoad and a bunch of user controls with buttons. When a button in user control is clicked, an iframe inside the window is updated client-side and the window is displayed (modal). Everything works fine when the page is not scrolled down. When the page is scrolled down and a button is clicked on any of the bottom user controls, I have to scroll up to see the window.

Is there anyway to make the Ext:Window show up in the centre of the screen, regardless of the scroll position (e.g. like Ext.Confirm -- it is always displayed in the centre)?

I believe the problem is that the window already exists and it's just being hidden/shown, but it doesn't know that the document scrolled down. So the question is: how do I tell the window what the new "center" is? My guess would be to create a BeforeShow listener for the window, but what do I set in the listener?

Thank you!

Last Login: 12/28/2008 11:07:32 PM
Posts: 52,
Posted 7/30/2008 8:21:19 AM

Group: Coolite Early Adopter

I have found the window.center() method in ExtJS documentation and added it to my code (client-side scripts call window.center() after window.show()). This seems to help a little, but sometimes the window is still offset (well, at least with .center() part of the window is always in the viewable zone). I wonder if the problem could be caused by the fact that the page uses table design? (header row, navigation cell, content cell, footer row; everything in content cell does not use tables inside)

Thanks!

Last Login: 12/28/2008 11:07:32 PM
Posts: 52,
Posted 8/13/2008 2:21:21 PM

Group: Coolite Early Adopter

Hm... I made a quick test and looks like table design is not the reason for wrong window placement. I ran across the following post http://extjs.com/forum/showthread.php?t=41100&highlight=window+position

Does this mean that Coolite 0.5.4 also has this problem? (window.center() does not take into account scroll position). Is this going to be fixed in 0.6?

Thanks!

« Prev Topic | Next Topic »
Reading This Topic
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.
All times are GMT -8:00, Time now is 3:27am