Programmatically click a cell in a grid to run the GridCommand Command

  1. #1

    Programmatically click a cell in a grid to run the GridCommand Command

    Hi,
    I am new to EXT.Net and cannot find the way to do the folowing:

    I need to run a javascript on the on the browser to click an a gridpanel's icon to delete a row from the grid.

    Im my aspx.net I have the colum that i need to click defined like this:
    ...
    <ext:CommandColumn Width="22" Fixed="true" MenuDisabled="true">
                                                    <Commands>
                                                        <ext:GridCommand Icon="Delete" CommandName="Delete" ToolTip-Text="Delete"  />
                                                    </Commands>
                                                    <PrepareToolbar Handler="return record.data.Name.toLowerCase() != 'unattached' && record.data.Name.toLowerCase() != 'dynamic channels'" />
                                                    </ext:CommandColumn>s>
    ...

    I can think of 2 main ways to do that:
    1. find the row I need to delete using javascript, find the cell and click it
    I tried this:
    var records = Ext.getCmp('gridPanel_ContentGroups').getStore().getRange();
    but after I got the desired record (by the name of the first column))I could not proceed to the delete icon that is in one of the cells in that row.
    I expected to be able to write somthing like
    myRecord.getRow().RowColumns[2].click().
    But I found nothing simiiliar.

    2. A second way , could have been to triger the "Delete" command name on that row directly from the javasccript, but again I did not find any reference or example on that.

    Thanks for any suggestions and help! :)
    Last edited by Daniil; Apr 11, 2012 at 12:50 PM. Reason: Please use [CODE] tags
  2. #2
    Hi,

    Welcome to Ext.NET!

    Seems your first requirement is the same as here:
    http://forums.ext.net/showthread.php?18302

Similar Threads

  1. Replies: 0
    Last Post: May 12, 2012, 11:24 AM
  2. Replies: 0
    Last Post: Feb 09, 2012, 2:39 PM
  3. Cancel grid row selection when command click?
    By Nagaraju in forum 1.x Help
    Replies: 0
    Last Post: Mar 08, 2011, 4:40 AM
  4. GridCommand programmatically visible
    By 78fede78 in forum 1.x Help
    Replies: 0
    Last Post: Sep 15, 2010, 1:32 PM
  5. [CLOSED] Download file in grid command column click
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 31, 2010, 12:08 PM

Posting Permissions