[CLOSED] Is it possible to control child form controls from main form?

  1. #1

    [CLOSED] Is it possible to control child form controls from main form?

    Hi,

    In a web form there are two panels one at north which contains only Navigation controls and another panel at center which autoload with child form. I want to access controls on child form from navigation menu either with javascript or code behind. Is it possible?
    Last edited by Daniil; Aug 13, 2012 at 12:51 PM. Reason: [CLOSED]
  2. #2
    Geoffrey McGill
    Founder
  3. #3
    Hi Geoffrey Mcgill,

    Here I am giving the code for main form and child form. I want to activate accordion panels in child form by clicking on buttons on main form without refresh child form.

    Main form code...

    <%@ 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">
    <script runat="server">
    
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Viewport runat="server" Layout="border" ID="vpCommonPage">
            <Items>
                <ext:Panel ID="pnlTops" runat="server" Region="North" Height="30">
                    <TopBar>
                        <ext:Toolbar runat="server" ID="tbTop">
                            <Items>
                                <ext:Button ID="btn1" runat="server" Text="Activate Accordion Item 1">
                                </ext:Button>
                                <ext:Button ID="btn2" runat="server" Text="Activate Accordion Item 2">
                                </ext:Button>
                                <ext:Button ID="btn3" runat="server" Text="Activate Accordion Item 3">
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Items>
                    </Items>
                </ext:Panel>
                <ext:Panel ID="pnlMain" runat="server" Padding="5" Region="Center" BodyStyle="background-color:#DCEAFB">
                    <AutoLoad Mode="IFrame" NoCache="true" ShowMask="true" MaskMsg="Loading..." Url="ExtAccordionPage.aspx"/>
                </ext:Panel>
            </Items>
        </ext:Viewport>
        </form>
    </body>
    </html>
    Child form code...

    <%@ 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">
    <script runat="server">
    
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Viewport ID="vpSearchCommon" runat="server" Layout="border">
            <Items>
                <ext:Panel ID="pnlAccordion" runat="server" Region="Center" Border="true" Layout="AccordionLayout"
                    Title="Accordion Test" BodyStyle="background-color:#d9d9d9">
                    <Items>
                    <ext:Panel ID="pnlAccordion1" runat="server" Title="Accordion Panel 1" BodyStyle="background-color:#d9d9d9" Border="false"></ext:Panel>
                    <ext:Panel ID="pnlAccordion2" runat="server" Title="Accordion Panel 2" BodyStyle="background-color:#d9d9d9" Border="false"></ext:Panel>
                    <ext:Panel ID="pnlAccordion3" runat="server" Title="Accordion Panel 3" BodyStyle="background-color:#d9d9d9" Border="false"></ext:Panel>
                    </Items>
                </ext:Panel>
            </Items>
        </ext:Viewport>
        </form>
    </body>
    </html>
    Click image for larger version. 

Name:	MainFormImage.PNG 
Views:	111 
Size:	17.6 KB 
ID:	4621

  4. #4
    Hi,

    Example
    pnlMain.getBody().pnlAccordion.layout.setActiveItem(index)
    See also
    https://examples1.ext.net/#/Panel/Ba...Communication/
    http://docs.sencha.com/ext-js/3-4/#!...-setActiveItem

    Please post any Ext.NET v1 related technical support questions on the Premium Help 1.x forum.
  5. #5
    Hi Daniil,

    Thank you it is working
    Quote Originally Posted by Daniil View Post
    Hi,

    Example
    pnlMain.getBody().pnlAccordion.layout.setActiveItem(index)
    See also
    https://examples1.ext.net/#/Panel/Ba...Communication/
    http://docs.sencha.com/ext-js/3-4/#!...-setActiveItem

    Please post any Ext.NET v1 related technical support questions on the Premium Help 1.x forum.

Similar Threads

  1. Replies: 5
    Last Post: May 11, 2012, 4:56 PM
  2. Replies: 2
    Last Post: Aug 29, 2011, 3:53 PM
  3. Replies: 1
    Last Post: Aug 02, 2011, 12:59 PM
  4. Replies: 1
    Last Post: Apr 15, 2009, 3:35 PM
  5. Replies: 0
    Last Post: Apr 09, 2009, 4:49 PM

Tags for this Thread

Posting Permissions