Combobox: Hide / Show an object

  1. #1

    Combobox: Hide / Show an object

    Hi every1,

    I have this code:

    <Items>
                                                                <ext:ComboBox ID="cboOpt" runat="server" BoxLabel="Option" EmptyText="<none>">
                                                                    <Items>
                                                                        <ext:ListItem Text="Opt 1" Value="1" />
                                                                        <ext:ListItem Text="Opt 2" Value="2" />
                                                                    </Items>
                                                                </ext:ComboBox>
                                                            </Items>
    How to show/hide an object after changing combobox option? I've tried put "OnTextChanged" event but it didnt work


    thanks in advance
  2. #2
    Hi,

    Use Select listener of combobox
    <ext:ComboBox ID="cboOpt" runat="server" BoxLabel="Option" EmptyText="<none>">
        <Items>
           <ext:ListItem Text="Opt 1" Value="1" />
           <ext:ListItem Text="Opt 2" Value="2" />
        </Items>
        <Listeners>
            <Select Handler="if(this.getValue() == 1) {#{Panel1}.hide();} else {#{Panel1.show();}}" />
        </Listeners>
    </ext:ComboBox>
  3. #3
    Vladimir, many thanks it worked but I've another problem with this Panel. First of all, I changed select combo to checkBox. These checkboxs set the panel on or off, but the objects inside the panel are not appearing:


    <ext:RadioGroup ID="CompositeField16" runat="server" Width="200">
       <Items>
          <ext:Radio ID="Chk1" runat="server" BoxLabel="Title 1">
            <Listeners>
              <Check Handler="if(!this.checked)#{pnlGeneral}.show();else #{pnlGeneral}.hide();" />
            </Listeners>
          </ext:Radio>
          <ext:Radio ID="chk2" runat="server" BoxLabel="Title 2">
            <Listeners>
              <Check Handler="if(this.checked)#{pnlGeneral}.show();else #{pnlGeneral}.hide();" />
              <Render Handler="#{pnlGeneral}.hide();" />
           </Listeners>
         </ext:Radio>
       </Items>
    </ext:RadioGroup>
    <ext:Panel ID="pnlGeneral" runat="server" Border="false" Padding="2" Layout="FormLayout" LabelAlign="Top" Width="700">
       <Items>
         <ext:CompositeField ID="CompositeField1" runat="server" AnchorHorizontal="-20" MsgTarget="Side" Width="700">
           <Items>
             <ext:Label runat="server" Html="<b>Title 1</b>" Width="250">
             </ext:Label>
             <ext:Label runat="server" Html="<b>Title 2</b>" Height="30">
             </ext:Label>
           </Items>
         </ext:CompositeField>
       </Items>
    </ext:Panel>
    I've already tried to use "AfterRender" but I got the same problem..


    tks

Similar Threads

  1. Show/Hide fieldset
    By JosefTrbusek in forum 2.x Help
    Replies: 2
    Last Post: Aug 03, 2012, 7:04 AM
  2. [CLOSED] Hide and Show a Tab in Select Event of a ComboBox
    By pdcase in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 11, 2010, 2:32 PM
  3. don't show values in object window?
    By carlosmupe in forum 1.x Help
    Replies: 1
    Last Post: Dec 14, 2009, 3:00 PM
  4. Show/Hide tabs
    By stone216 in forum 1.x Help
    Replies: 2
    Last Post: Oct 01, 2009, 8:21 PM
  5. Replies: 0
    Last Post: Apr 14, 2009, 12:33 PM

Tags for this Thread

Posting Permissions