[CLOSED] Load Window from UserControlLoader in Panel

  1. #1

    [CLOSED] Load Window from UserControlLoader in Panel

    Hi there,

    I am currently facing a problem with launching a Window from within a UserControl that is loaded inside of a Panel.

    Basically the structure is that I have a GroupTabPanel with three Panels as the groups. Each Panel has multiple Items that are UserControlLoader. Inside of the UserControls are the GridPanel that I want to display in each GroupTabPanel Section.

    This is identical to the example listed here http://examples2.ext.net/#/TabPanel/...anel/Overview/

        <ext:Viewport runat="server" Layout="Border" ID="TheViewport">
            <Items>
                <ext:GroupTabPanel runat="server" region="Center" ID="GroupPanel" >
                    <Items>
                        <ext:Panel runat="server" ID="Group_0">
                            <Items>
                                <ext:UserControlLoader runat="server" Path="editUser.ascx" UserControlID="editUser"></ext:UserControlLoader>
                            </Items>
                        </ext:Panel>
                   </Items>
               </ext:GroupTabPanel>
            </Item>
        </ext:Viewport>
    My question is: how can I open a Window Element from within one of these UserControls, that are loaded inside the Panels that represent the GroupTabPanel groups?

    When I try to open the Window it throws a JavaScript error Uncaught TypeError: Cannot call method 'getViewRegion' of undefined
    Also the Window appears aligned to the top left browser window corner, is not draggable and the Toolbar of the GripView also loaded from the UserControl overlays the Window. Very weird.

    editUser.ascx looks like this

        <ext:Window runat="server" ID="NewBoxWindow" Icon="TransmitAdd" Title="Neue Box anlegen" Width="460" Height="600" Hidden="true">
            <Items>
                ...
            </Items>
        </ext:Window>

    I am guessing I have to set the renderTo Property to the Viewport or something like that. But how would I do that?


    Thank you for any help,

    Thomas
    Last edited by Daniil; Mar 14, 2014 at 8:27 AM. Reason: [CLOSED]
  2. #2
    Hi @blueworld,

    I think putting it into a Panel's Bin would be a good solution.

    Page
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Panel runat="server" Title="Some Panel">
                <Bin>
                    <ext:UserControlLoader runat="server" Path="TestUC.ascx" UserControlID="UserControl1" />
                </Bin>
            </ext:Panel>
    
            <ext:Button runat="server" Text="Show" Handler="App.UserControl1_Window1.show();" />
        </form>
    </body>
    </html>
    User Control
    <%@ Control Language="C#" %>
    
    <ext:Window ID="Window1" runat="server" />
    When I try to open the Window it throws a JavaScript error Uncaught TypeError: Cannot call method 'getViewRegion' of undefined
    Also the Window appears aligned to the top left browser window corner, is not draggable and the Toolbar of the GripView also loaded from the UserControl overlays the Window. Very weird.
    I think a JavaScript error just breaks everything.
  3. #3

    Just a friendly tip in case you didn't know...

    It's helpful to know that the <Bin> section is designed for Ext.Net controls that do not actually participate in the layout of a parent panel/container content. Window is a perfect example because it won't affect the spacing or position of contents on the page. Floating Menus, Targeted Tooltips, Timers, and even UserControls that contain these at the top level (using UserControlLoader) are other examples of controls that go there.

Similar Threads

  1. [CLOSED] Dynamic Ext.Net.Window with UserControlLoader
    By luiz in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 09, 2013, 4:22 AM
  2. Replies: 4
    Last Post: Sep 27, 2013, 12:09 PM
  3. [CLOSED] Load Mask Not displaying on Grid Panel data load
    By WHISHWORKS in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 17, 2013, 3:44 PM
  4. [CLOSED] IE 9 - North panel doesn't load, until I resize window
    By rthiney in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jun 05, 2013, 4:18 PM
  5. [CLOSED] How to use an IFrame to load a page without a panel or window?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 02, 2010, 5:21 PM

Tags for this Thread

Posting Permissions