[CLOSED] How to : show a panel and hide other when one Radio is clicked

  1. #1

    [CLOSED] How to : show a panel and hide other when one Radio is clicked

    Hi folks,

    Can you provide me an example where one radio (I really need two radio items) is pressed show a first panel and hiddes a second. And when second radio items is pressed show second panel and hiddes the first panel.

    Cheers!
    Last edited by Daniil; Dec 19, 2011 at 1:59 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Here you are.

    Example
    <%@ 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 runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:RadioGroup runat="server" ColumnsNumber="1">
                <Items>
                    <ext:Radio ID="Radio1" runat="server" BoxLabel="Panel 1" />
                    <ext:Radio ID="Radio2" runat="server" BoxLabel="Panel 2" />
                </Items>
                <Listeners>
                    <Change Handler="switch (checked.id) {
                                         case 'Radio1' :
                                             Container1.layout.setActiveItem(0);
                                             break;
                                         case 'Radio2' :
                                             Container1.layout.setActiveItem(1);
                                             break;
                                     }" />
                </Listeners>
            </ext:RadioGroup>
            <ext:Container ID="Container1" runat="server" Layout="CardLayout">
                <Items>
                    <ext:Panel runat="server" Title="Panel 1" Html="Panel 1" />
                    <ext:Panel runat="server" Title="Panel 2" Html="Panel 2" />
                </Items>
            </ext:Container>
        </form>
    </body>
    </html>
  3. #3
    Daniil,

    thanks a lot. Your example works right.

    Cheers!!

Similar Threads

  1. [CLOSED] TabPanel Show/Hide Panel
    By amitpareek in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 02, 2012, 3:21 PM
  2. [CLOSED] Radio group can not show in panel toolbar
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 26, 2011, 2:08 PM
  3. Replies: 5
    Last Post: May 05, 2011, 7:05 PM
  4. [CLOSED] Show Hide Grid Panel from runtime
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 23, 2011, 6:32 PM
  5. Show and Hide Panel with javascript in Chrome
    By Paul D in forum 1.x Help
    Replies: 5
    Last Post: Nov 11, 2010, 7:53 PM

Posting Permissions