-
8 Dec 2010 3:19 AM #1
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
-
8 Dec 2010 5:47 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,246
- Vote Rating
- 97
Code:if (!win.rendered) { win.render(Ext.getBody()); } win.setPagePosition(e.getXY()); win.show();
-
8 Dec 2010 10:49 PM #3
-
8 Dec 2010 11:59 PM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,246
- Vote Rating
- 97
What didn't work?
-
9 Dec 2010 12:52 AM #5
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.
-
9 Dec 2010 12:56 AM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,246
- Vote Rating
- 97
OK, you need to use setPosition instead of setPagePosition, or just assign an x and an y to the window.
-
9 Dec 2010 1:00 AM #7
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).
-
5 May 2011 10:13 PM #8
Thanx a lot
Thanx a lot


It helps me a lot..Really thank full to you
-
23 May 2012 2:58 AM #9
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 advanceSamarth Manjunath
-
23 May 2012 4:45 AM #10
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
-
containing changes to window.location within Ext.Window
By cnesbit in forum Ext 3.x: Help & DiscussionReplies: 6Last Post: 31 Aug 2009, 11:52 AM -
How to position ext window ?
By JDevloper in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 2 Nov 2008, 2:36 AM -
Ext.window fire button when enter clicked?
By ehask71 in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 3 Jul 2008, 2:37 PM -
window.location(document.location) in Grid's listener
By SunLiWei in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 26 Sep 2007, 6:31 AM
Reply With Quote