Menu Row Command - which Menu Item Clicked? (as param?)

  1. #1

    Menu Row Command - which Menu Item Clicked? (as param?)

    I see in the example - being able to reference a record value - but is there any way to reference which specifici menu item was clicked as well? So that if they click menu item 1 I do action1, etc.
  2. #2

    RE: Menu Row Command - which Menu Item Clicked? (as param?)

    Hi,

    I take it you mean from a grid command???

    add in the following code in the AjaxEvents for the grid in question..

    <AjaxEvents>
                                                    <Command OnEvent="GridCommand">
                                                        <EventMask ShowMask="true" Target="CustomTarget" Msg="Loading Article" CustomTarget="={#{ArticlesGrid}.body}" />
                                                        <ExtraParams>
                                                            <ext:Parameter Name="Command" Value="command" Mode="Raw" />
                                                            <ext:Parameter Name="Values" Value="Ext.encode(#{Grid}.getRowsValues())" Mode="Raw" />
                                                            <ext:Parameter Name="SelectedRecord" Value="Ext.encode(#{Grid}.getRowsValues())" Mode="Raw" />
                                                        </ExtraParams>
                                                    </Command>
    You'll see i've passed a "command" value which will be the command clicked and also both the values and selected record

    then in your GridCommand subroutine simply do a Select Case

    
    Select Case e.ExtraParams("Command")
    
    Case "commandname"
    
        Command Actions go here
  3. #3

    MenuItem Click Get CustomConfig

    Hi, how to get the url parameter of menuitem?
    I would like to send as parameter to the test event.

    <ext:MenuPanel runat="server">
    <Menu runat="server">
    <Items>
    <ext:MenuItem runat="server" Text="Extrato de Pontuação" Icon="ArrowRight">
    <CustomConfig>
    <ext:ConfigItem Name="url" Value="~/Views/Extrato/ExtratoDePontuacao.aspx" Mode="Value" />
    </CustomConfig>
    </ext:MenuItem>
    <ext:MenuItem runat="server" Text="Extrato de Convênio" Icon="ArrowRight">
    <CustomConfig>
    <ext:ConfigItem Name="url" Value="/Views/Extrato/ExtratoDeConvenio.aspx" Mode="Value" />
    </CustomConfig>
    </ext:MenuItem>
    </Items>
    <DirectEvents>
    <Click OnEvent="Teste" Before="alert(this.id);">
    <EventMask Msg="Aguarde carregando" ShowMask="True">
    </EventMask>
    </Click>
    </DirectEvents>
    </Menu>
    </ext:MenuPanel>

Similar Threads

  1. Replies: 8
    Last Post: Jul 29, 2012, 10:58 AM
  2. Replies: 2
    Last Post: Apr 02, 2012, 7:48 AM
  3. Replies: 2
    Last Post: Feb 22, 2012, 4:16 PM
  4. [CLOSED] How to set the selected Menu Item at <ext:Menu>
    By farisqadadeh in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 06, 2011, 11:59 AM
  5. [CLOSED] Menu inside Component menu item
    By tansu in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 15, 2010, 2:32 PM

Posting Permissions