[CLOSED] Window position relative

  1. #1

    [CLOSED] Window position relative

    Window1 must be positioned with respect to Button1.
    is it possible?

    
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Basic Hello World Window - Ext.NET Examples</title>
        <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            
            <h1>Simple Ext.NET Window Sample</h1>
            
            <p>The following example demonstrates how to configure a new Window Component and "show" the Window if closed.</p>
        
            <ext:Button ID="Button1" runat="server" Text="Show Window (Client Event)" Icon="Application">
                <Listeners>
                    <Click Handler="#{Window1}.show();" />
                </Listeners>
            </ext:Button>
            
            <br />
            
          
            
            <ext:Window 
                ID="Window1" 
                runat="server" 
                Title="Hello World!"  
                Icon="Application"
                Height="185px" 
                Width="350px"
                BodyStyle="background-color: #fff;" 
                Padding="5"
                Collapsible="true" 
                Modal="true">
                <Content>
                    This is my first <a target="_blank" href="http://www.ext.net/"> Ext.Net</a> Window.
                </Content>
            </ext:Window>
        </form>
    </body>
    </html>
    Last edited by Daniil; Nov 12, 2010 at 7:54 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use the Window's Show event.

    Example
    <ext:Window
        ...
        <Listeners>
            <Show Handler="this.setPosition(Button1.getPosition());"/>
        </Listeners>
    </ext:Window>
  3. #3
    The releative position must be 10px right and 20px than the Button1.
    is it possible?
  4. #4
    Hi,

    Please use the following code:

    Example
    <ext:Window ...>
        ...
        <Listeners>
            <Show Handler=" var pos = Button1.getPosition();
                            pos[0] += 10;
                            pos[1] += 20;
                            this.setPosition(pos);"/>
        </Listeners>
    </ext:Window>
  5. #5
    The client-side documentation is available for .getPosition() and .setPosition(), see

    http://dev.sencha.com/deploy/dev/doc...er=getPosition

    The .setPosition() function available on the same page.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Get the x,y position of a modal window
    By fordprefect in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 08, 2011, 6:26 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] Ext.Window x,y position not working?
    By geodan in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 12, 2010, 2:20 AM
  4. ext:Window position
    By haltenberg in forum 1.x Help
    Replies: 2
    Last Post: Aug 13, 2008, 6:21 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