View Full Version : get selected row in grid and pass to server side

Mar 07, 2011, 11:58 PM

I need to know row index of selected row so I can use it on server side.

On my grid I have this:

<ext:GridPanel ID="GridPanel1" runat="server" StripeRows="true" Title="EmQ"
Icon="UserSuit" Visible="true" AutoDataBind="True" Region="Center" Frame="true"">
<ColumnModel ID="ColumnModel1" runat="server">
<ext:Column Header="First Name" DataIndex="FN"></ext:Column>
<ext:Column ColumnID="ID" Header="Last Name" DataIndex="LN"></ext:Column>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
<RowSelect Handler="#{FormPanel1}.getForm().loadRecord(record);" />

and on button (event when i edit selected row) I have this:

<ext:Button ID="btnEdit" runat="server" AutoPostBack="true" Text="Edit" Region="Center" Width="60" Height="25" OnClick="btnEdit_OnClick">
<Click Handler="#{GridPanel1}.getStore().reload();" />

Can you show me how can i get row index of selected row? I suppose I need to put ExtraParams on Button/Listener..?i'm new in this, and I'll appreciate if you give me solution for this.