PDA

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



Aleksa007
Mar 07, 2011, 11:58 PM
Hi...

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">
<Columns>
<ext:Column Header="First Name" DataIndex="FN"></ext:Column>
<ext:Column ColumnID="ID" Header="Last Name" DataIndex="LN"></ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
<Listeners>
<RowSelect Handler="#{FormPanel1}.getForm().loadRecord(record);" />
</Listeners>
</ext:RowSelectionModel>
</SelectionModel>
</ext:GridPanel>


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

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

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.