Open Window with URL from grid panel

  1. #1

    Open Window with URL from grid panel

    How do I open a window from the a grid panel with the content based on the selected row?

    I can open a window from the grid panel when I select a row. However, whenever I change the URL in code-behind based on the selected row, the window does not show. To simplify, the initial configuration shows CNN.COM, but when I want to show EXT.NET after selecting a row, the window does not show. Ultimately, the window's content will be driven by the selected row, but one step at a time.....


    <ext:Window 
    ID="WindowViewDocument"  runat="server"  Height="200" Width="200"
         Modal = "true" AutoRender = "false"  Collapsible = "true"
         Maximizable = "true"  Hidden = "true">
    <Loader ID="LoaderViewDocument" 
        runat="server" 
        Url="http://www.cnn.com"
       Mode="Frame" 
        TriggerEvent="show" 
        ReloadOnEvent="true"                         
        DisableCaching="true">
       <LoadMask ShowMask="true" />
    </Loader>
    </ext:Window>

    Code-behind:
    protected void RowSelect(object sender, Ext.Net.DirectEventArgs e)
    {
      string DocumentID = e.ExtraParams["DocumentID"];
      docID = int.Parse(DocumentID);
                // This is what I ultimately want to show, but one step at a time..... 
                //      this.WindowViewDocument.Loader.Url = "http://localhost:49953/views/employee/documentview.aspx?DocumentId=" + DocumentID ;         
      this.WindowViewDocument.Loader.Url = "http://www.ext.net";
    
    
      this.WindowViewDocument.Reload();
      this.WindowViewDocument.Show();
    }
    Any help is greatly appreciated!
    Manni
  2. #2
    I guess that there are some problem with Window's Loader ID that's why it is not working. But temporarily you can use this code:

    <!DOCTYPE html>
    
    <html>
    <head id="Head1" runat="server">
        <script runat="server">
            protected void OpenWindowBtnClick(object sender, Ext.Net.DirectEventArgs e)
            {
                ResourceManager1.RegisterClientScriptBlock("changeUrlOfLoader", "App.WindowViewDocument.loader.url ='http://www.ext.net';");
                this.WindowViewDocument.Show();
            }
        </script>
    </head>
    <body>
            <ext:ResourceManager ID="ResourceManager1" runat="server" ScriptMode="Debug" SourceFormatting="True" />
            
            <ext:Window
                ID="WindowViewDocument"  runat="server"  Height="200" Width="200"
                     Modal = "true" AutoRender = "false"  Collapsible = "true"
                     Maximizable = "true"  Hidden = "true">
                <Loader ID="LoaderViewDocument"
                    runat="server"
                    Url="http://www.cnn.com"
                   Mode="Frame"
                    TriggerEvent="show"
                    ReloadOnEvent="true"                        
                    DisableCaching="true" >
                   <LoadMask ShowMask="true" />
                </Loader>
            </ext:Window>
            
            <ext:Button runat="server" ID="ChangeWindowUrlBtn" Text="Change URL">
                <DirectEvents>
                    <Click OnEvent="OpenWindowBtnClick"></Click>
                </DirectEvents>
            </ext:Button>
            <ext:Button runat="server" ID="OpenWindowBtn" Text="Show me">
                <Listeners>
                    <Click Handler="#{WindowViewDocument}.show();"></Click>
                </Listeners>
            </ext:Button>
    </body>
    </html>
    Last edited by geoffrey.mcgill; Nov 07, 2012 at 12:55 AM.
  3. #3
    @Baidaly: Thank you very much for your suggestion. Sorry for the late response.

    After some more digging, I came across the LoadContent method which solved the problem.

     protected void RowSelect(object sender, Ext.Net.DirectEventArgs e)
    {
      string DocumentID = e.ExtraParams["DocumentID"];
      string myurl = "http://xxxxxxxxxx/DocumentView.aspx?DocumentID=" + DocumentID;
      this.WindowViewDocument.Show();
      WindowViewDocument.Hidden = false;
      WindowViewDocument.LoadContent(myurl);
    }

Similar Threads

  1. [CLOSED] How to position a window into a desktop on window open
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 26, 2012, 1:59 PM
  2. BorderLayout open a window black window
    By Hualin Yuan in forum 1.x Help
    Replies: 0
    Last Post: May 07, 2010, 3:03 AM
  3. Replies: 0
    Last Post: Mar 19, 2010, 5:18 PM
  4. Replies: 1
    Last Post: Feb 17, 2010, 9:38 AM
  5. grid panel inside a window
    By [WP]joju in forum 1.x Help
    Replies: 4
    Last Post: Feb 09, 2009, 6:11 AM

Tags for this Thread

Posting Permissions