[CLOSED] ComponentMenuItem: the best way to hide/deactivate?

  1. #1

    [CLOSED] ComponentMenuItem: the best way to hide/deactivate?

    Hi all,
    i have a ComponentMenuItem with a FormPanel inside. I have also some buttons.
    The MenuItem should disappear when the button is clicked.

    Which is the best way to achive it?

        <ext:Toolbar ID="Toolbar1" runat="server">
            <Items>
                <ext:Button ID="Button1" runat="server" Text="Click">
                    <Menu>
                        <ext:Menu ID="Menu1" runat="server">
                            <Items>
                                <ext:ComponentMenuItem ID="MenuItem" Shift="true">
                                    <Component>
                                        <ext:FormPanel ID="FormPanel1" 
                                            runat="server" 
                                            Border="false" 
                                            Padding="5"
                                            Layout="form"
                                            LabelAlign="Top"
                                            MonitorValid="true"
                                            BodyStyle="background-color:transparent;">
                                            <Items>
                                                <ext:TextField
                                                    runat="server"
                                                    ID="TextField"
                                                    Width="200" 
                                                    MsgTarget="Title" 
                                                    AllowBlank="false"
                                                    FieldLabel="String" />
                                            </Items>
                                            <Listeners>
                                                <ClientValidation Handler="Button.setDisabled(!valid);" />
                                            </Listeners>
                                            <Buttons>
                                                <ext:Button ID="Button" runat="server" Text="Ok" Icon="BulletTick">
                                                    <Listeners>
                                                        <Click Handler="MenuItem.hide();" />
                                                    </Listeners>
                                                </ext:Button>
                                            </Buttons>
                                        </ext:FormPanel>
                                    </Component>
                                </ext:ComponentMenuItem>
                            </Items>
                        </ext:Menu>
                    </Menu>
                </ext:Button>              
            </Items>
        </ext:Toolbar>
    Last edited by Daniil; Nov 05, 2010 at 10:40 AM. Reason: [CLOSED]
  2. #2
    Hi capecod,

    I'm not sure there is any way better than the hide() method.

    What about disabling of TextField?

    Example
    <ext:Button ID="Button" runat="server" Text="Ok" Icon="BulletTick">
        <Listeners>
            <Click Handler="TextField.disable();" />
        </Listeners>
    </ext:Button>
  3. #3
    When i click outside the ComponentMenuItem it disappear.

    Is there a way to call that code?
  4. #4
    Hi,

    Please use
    Menu1.hide()
  5. #5
    Awesome!
    Much simpler than i was thinking... now that i know the solution :cool:
  6. #6
    Yes, Ext.Net/ExtJS are very flexible and have a great API.

    To get a solution for many tasks it just needs to have a look at the docs.

    In this case I looked at Menu's API and got this
    http://dev.sencha.com/deploy/dev/doc...nu&member=hide

Similar Threads

  1. [CLOSED] StringFilter and DateFilter activate/deactivate
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 06, 2012, 3:58 PM
  2. [CLOSED] FileUploadField in ComponentMenuItem problem
    By xeo4.it in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 14, 2012, 1:13 PM
  3. [CLOSED] Deactivate tab at runtime
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 24, 2011, 4:07 PM
  4. [CLOSED] Bug with .ToScript() for ComponentMenuItem
    By pil0t in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 05, 2010, 4:25 PM
  5. [CLOSED] Deactivate Rows in a CheckBoxSelectionModel
    By macap in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 19, 2010, 9:26 AM

Posting Permissions