Hi Valdsch,
Thanks for the snippet of code, actually I want to get the row value when I press enter key
I wrote a meathod to get the row value when the user double clicks the row.
I want to call the same method when the user presses "Enter Key"
With the below mentioned code I was not able to do so, we need a ajax method to do and it needs parameter values too
how to get the grid row value in enter key press
Markup
<AjaxEvents>
<CellDblClick OnEvent="NavigateToDetails" Success="Ext.getBody().mask('Loading...', 'x-loading-mask')" Failure="Ext.MessageBox.alert('Load failed', 'Error during ajax event!');">
<EventMask ShowMask="true" Target="CustomTarget" CustomTarget="={#{CoolGrid1}.body}" />
<ExtraParams>
<ext:Parameter Name="SelectedRecord" Value="Ext.encode(#{CoolGrid1}.getRowsValues(true))"
Mode="Raw" />
</ExtraParams>
</CellDblClick>
</AjaxEvents>
<KeyMap>
<ext:KeyBinding>
<keys>
<ext:Key Code="ENTER" />
</keys>
<listeners>
<Event Handler="Coolite.AjaxMethod.AjaxNavigateToDetails()" />
</listeners>
</ext:KeyBinding>
</KeyMap>
Code Behind
protected void NavigateToDetails(object sender, AjaxEventArgs e)
{
string JsonRecord = e.ExtraParams["SelectedRecord"];
string projectID = "";
Dictionary<string, string>[] gridData = JSON.Deserialize<Dictionary<string, string>[]>(JsonRecord);
foreach (IDictionary<string, string> JColumn in gridData)
{
projectID = JColumn ["TaskId"];
}
if (projectID != ""){
Response.Redirect("TestForm.aspx?isproject=1&ListView=Projects&recordid=" + projectID);//&recordid="+sr.RecordID);
}
}
Any suggestions ?