[CLOSED] GridCommand Add Handler ?

  1. #1

    [CLOSED] GridCommand Add Handler ?

    Hi all, first Time use of GridCommand :-)

                        <ext:CommandColumn Width="60">
                          <Commands>
                            <ext:GridCommand Icon="PageLink" CommandName="cmdShowBordereau">
                              <ToolTip Text="Bordereau" />
                            </ext:GridCommand>
                            <ext:GridCommand Icon="LorryLink" CommandName="cmdShowShipment">
                              <ToolTip Text="Shipment" />
                            </ext:GridCommand>
                          </Commands>
                        </ext:CommandColumn>
    Can I add a Handler to this Commands in Code Behind ?
    If so - how ?

    Kind Regards
    Peter
    Last edited by Daniil; May 11, 2011 at 12:25 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please use Command event (Listener/DirectEvent) of GridPanel
    Please see
    https://examples1.ext.net/#/GridPane...s/Row_Command/
  3. #3
    So far, so good...
    But how can I pass the Parameters ?

    Here's my Code

                        <ext:CommandColumn Width="60">
                          <Commands>
                            <ext:GridCommand Icon="PageLink" CommandName="cmdShowBordereau">
                              <ToolTip Text="Bordereau" />
                            </ext:GridCommand>
                            <ext:GridCommand Icon="LorryLink" CommandName="cmdShowShipment">
                              <ToolTip Text="Shipment" />
                            </ext:GridCommand>
                          </Commands>
                        </ext:CommandColumn>
                      </Columns>
                    </ColumnModel>
                    <SelectionModel>
                      <ext:RowSelectionModel runat="server" SingleSelect="true">
                        <DirectEvents>
                          <RowSelect OnEvent="GetDeclarationDetail">
                            <EventMask ShowMask="true" />
                            <ExtraParams>
                              <ext:Parameter Name="Values" Value="Ext.encode(#{DesclarationViewGrid}.getRowsValues({selectedOnly : true}))" Mode="Raw" />
                            </ExtraParams>
                          </RowSelect>
                        </DirectEvents>
                      </ext:RowSelectionModel>
                    </SelectionModel>
                    <DirectEvents>
                      <Click OnEvent="GetDeclarationCommand">
                        <EventMask ShowMask="true" />
                        <ExtraParams>
                          <ext:Parameter Name="CommandName" Value=command />
                          <ext:Parameter Name="Row" Value=record.data.id />
                        </ExtraParams>
                      </Click>
                    </DirectEvents>
    I think something like that, but how exactly ?

     <ext:Parameter Name="Values" Value="Ext.encode(#{DesclarationViewGrid}.getRowsValues({selectedOnly : true}))" Mode="Raw" />
  4. #4
    Well, your ExtraParams section looks almost fine.

    The following should work
    <ExtraParams>
         <ext:Parameter Name="CommandName" Value="command" Mode="Raw" />
         <ext:Parameter Name="Row" Value="record.data.id" Mode="Raw" />
     </ExtraParams>
  5. #5
    Also, as Vladimir mentioned you should use Command event, not Click.
    <Command OnEvent="GetDeclarationCommand">
  6. #6
    That worked !

                    <DirectEvents>
                    <Command OnEvent="GetDeclarationCommand" >
                      <EventMask ShowMask="true" />
                      <ExtraParams >
                        <ext:Parameter Name="CommandName" Value="command" Mode="Raw" />
                        <ext:Parameter Name="RowId" Value="record.data.Id" Mode="Raw" />
                      </ExtraParams>
                    </Command>
                    </DirectEvents>
    Thank you, solved :-)

Similar Threads

  1. [CLOSED] Fn vs Handler (when to use Fn and Handler)
    By hgouw in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 21, 2011, 1:39 AM
  2. [CLOSED] [1.0] GridCommand
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 08, 2011, 6:03 PM
  3. [CLOSED] GridCommand with DataIndex
    By xeo4.it in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Mar 18, 2011, 2:02 PM
  4. Help GridCommand
    By hbbazan in forum 1.x Help
    Replies: 11
    Last Post: Mar 05, 2010, 2:30 PM
  5. How to get the GridCommand name
    By wkcode in forum 1.x Help
    Replies: 2
    Last Post: Mar 03, 2010, 4:40 AM

Tags for this Thread

Posting Permissions