[CLOSED] Popup Window positioned over or near ImageCommand in GridPanel

  1. #1

    [CLOSED] Popup Window positioned over or near ImageCommand in GridPanel

    Hi, I have a GridPanel with an ImageCommand (V0.8.2)

    I popup a window (code for which is another ascx included in the page) through a Command Listener :

    <Listeners>
       <Command Fn="handleSelectedGridCommand" />
    </Listeners>
    
    
    <script type="text/javascript">
        var handleSelectedGridCommand = function(CommandName, record) {
               openPSSRTemplateAssigneToWindow(record);
        }
    
    </script>
    The ascx has the following script which succesfully opens a popup.
    <script type="text/javascript">
    
        var openPSSRTemplateAssigneToWindow = function (record) {
            var window = <%= PSSRTemplateAssignedToWindow.ClientID %>;
            window.show(record);
        }
    
    </script>
    The popup opens centered in the Page. What I would lilke to do is popup the window underneath or above the column containing the imagecommand, dependent on available screenspace; the same as a combobox would do? ) Failing that I would like to popup the window centered vertically but over the column with the image command.
    Appreciate anything you can offer to assist.
    Last edited by Daniil; Dec 13, 2010 at 12:38 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please look at the example.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Ext.IsAjaxRequest)
            {
                Store store = this.Store1;
                store.DataSource = new object[] { 
                                             new object[] {"test11", "test12" },
                                             new object[] {"test21", "test22" },
                                             new object[] {"test31", "test32" }
                                    };
                store.DataBind();
            }
        }
    </script>
    
    <!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 runat="server">
        <title>Coolite 0.8.X Example</title>
    
        <script type="text/javascript">
            var commandHandler = function(command, record, rowIndex, colIndex) {
                Window1.show();
                Window1.getEl().alignTo(GridPanel1.getView().getCell(rowIndex, colIndex));
            }
        </script>
    </head>
    <body>
        <form runat="server">
        <ext:ScriptManager runat="server">
            <Listeners>
                <DocumentReady Handler="Window1.hide();" />
            </Listeners>
        </ext:ScriptManager>
        <ext:Store ID="Store1" runat="server">
            <Reader>
                <ext:ArrayReader>
                    <Fields>
                        <ext:RecordField Name="test1" />
                        <ext:RecordField Name="test2" />
                    </Fields>
                </ext:ArrayReader>
            </Reader>
        </ext:Store>
        <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" AutoHeight="true">
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column Header="Test1" DataIndex="test1">
                        <Commands>
                            <ext:ImageCommand CommandName="command1" Icon="Accept" />
                        </Commands>
                    </ext:Column>
                    <ext:Column Header="Test2" DataIndex="test2">
                        <Commands>
                            <ext:ImageCommand CommandName="command2" Icon="Accept" />
                        </Commands>
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <Listeners>
                <Command Fn="commandHandler"/>
            </Listeners>
        </ext:GridPanel>
        <ext:Window ID="Window1" runat="server" Title="Test Window" />
        </form>
    </body>
    </html>
    See also
    http://dev.sencha.com/deploy/yui-ext...ss=Ext.Element

Similar Threads

  1. Replies: 1
    Last Post: Jun 18, 2012, 3:41 PM
  2. [CLOSED] How to remove 'X' (window close) for popup window?
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 31, 2011, 3:50 AM
  3. [CLOSED] Button event is not firing in parent window from popup window
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 14, 2011, 7:35 PM
  4. Replies: 1
    Last Post: Mar 14, 2011, 4:20 PM
  5. Replies: 1
    Last Post: Mar 11, 2011, 10:07 PM

Posting Permissions