Apr 09, 2012, 12:54 PM
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:
...
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:
I expected to be able to write somthing like
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! :)
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