ext:Window position

  1. #1

    ext:Window position



    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!
  2. #2

    RE: ext:Window position



    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!
  3. #3

    RE: ext:Window position



    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.ph...indow+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!

Similar Threads

  1. Opening Window at required position
    By designworxz in forum 1.x Help
    Replies: 1
    Last Post: Jan 11, 2012, 2:39 PM
  2. [CLOSED] Position window over existing div
    By tjbishop in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 12, 2011, 5:58 PM
  3. [CLOSED] Window position relative
    By 78fede78 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 24, 2010, 4:46 PM
  4. How to change position of window in AjaxEvent?
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: Apr 30, 2009, 2:20 PM
  5. Window Position between postbacks
    By tonytony in forum 1.x Help
    Replies: 4
    Last Post: Aug 08, 2008, 11:38 AM

Posting Permissions