1. #1
    Ext User
    Join Date
    Dec 2010
    Posts
    4
    Vote Rating
    0
    cubuzoa is on a distinguished road

      0  

    Default Ext window position at clicked location

    Ext window position at clicked location


    Dear all,
    I created a pop up window by using "Ext.window".When i click the button it pops up a window.I want to set the location of popup window by looking at mouse clicked position.For example When i click button,the popup window must be opened near that button.How can i do this?Is there anyway to set popup windows css to "position:fixed"?
    Thanks for advance

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    97
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Code:
    if (!win.rendered) {
      win.render(Ext.getBody());
    }
    win.setPagePosition(e.getXY());
    win.show();

  3. #3
    Ext User
    Join Date
    Dec 2010
    Posts
    4
    Vote Rating
    0
    cubuzoa is on a distinguished road

      0  

    Default


    It didn't work :-(

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    97
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    What didn't work?

  5. #5
    Ext User
    Join Date
    Dec 2010
    Posts
    4
    Vote Rating
    0
    cubuzoa is on a distinguished road

      0  

    Default


    Here is my code:
    win = new Ext.Window({
    applyTo : 'example',
    layout : 'auto',
    autoScroll : 'true',
    width : 650,
    height : 400,
    closeAction : 'hide',
    plain : true,
    html : oXHR.responseText,
    title:"example title",
    buttons: [{
    text : ' Add >> ',
    handler : function() {
    func1();
    win.hide();
    }
    }]
    });
    if (!win.rendered) {
    win.render(Ext.getBody());
    }
    win.setPagePosition(e.getXY());
    win.show();

    this code exist in a functions that belongs a button function.This window always pop up at center of page.I want to set window location manually.

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    97
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    OK, you need to use setPosition instead of setPagePosition, or just assign an x and an y to the window.

  7. #7
    Ext User
    Join Date
    Dec 2010
    Posts
    4
    Vote Rating
    0
    cubuzoa is on a distinguished road

      0  

    Default


    when i use x and y tags ,the window sets its position according to the top of the page.For example ,if the page is very long and i use the scroll and go to bottom of the page ,after i press that button scroll goes up and the window set its position at the top (if x:,y:0).

  8. #8
    Sencha User
    Join Date
    Apr 2011
    Posts
    9
    Vote Rating
    0
    Sreekesh S K is on a distinguished road

      0  

    Lightbulb Thanx a lot

    Thanx a lot




    It helps me a lot..Really thank full to you

  9. #9
    Sencha User
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    171
    Vote Rating
    0
    samarth is on a distinguished road

      0  

    Default


    Hi all this x and y will help. But whenever my screen resolution changes then this window won't be in a particular position. It will flow abnormally.

    Thanks in advance
    Samarth Manjunath

  10. #10
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    Not necessarily. I always set "constrain:true" to all my EXT windows so that they never flow outside of their parent, even if the x&y coordinates would normally push it outside...

Similar Threads

  1. containing changes to window.location within Ext.Window
    By cnesbit in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 31 Aug 2009, 11:52 AM
  2. How to position ext window ?
    By JDevloper in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 2 Nov 2008, 2:36 AM
  3. Ext.window fire button when enter clicked?
    By ehask71 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 3 Jul 2008, 2:37 PM
  4. window.location(document.location) in Grid's listener
    By SunLiWei in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 26 Sep 2007, 6:31 AM

Thread Participants: 4

Tags for this Thread