Jun 07, 2011, 3:17 PM
GridPanel pass RecordID in directmethod belonging to RowExpander
Hi,
Im trying to pass my selected row record id to a directmethod "approveOrder" when i click on a button which is under RowExpander component but i keep receiving null values. any idea how i can resolve this?
Im trying to pass my selected row record id to a directmethod "approveOrder" when i click on a button which is under RowExpander component but i keep receiving null values. any idea how i can resolve this?
[DirectMethod]
protected void approveOrder(object sender, DirectEventArgs e)
{
string a = RowSelectionModel1.SelectedRow.RecordID;
}
<ext:GridPanel ID="GridPanel1" runat="server" Height="500" Title="Title" AutoExpandColumn="receive">
<Store>
<ext:Store ID="store_order" runat="server">
<Reader>
<ext:JsonReader IDProperty="order_id">
<Fields>
<ext:RecordField Name="order_id" Type="Int"/>
<ext:RecordField Name="description" Type="String"/>
</Fields>
</ext:JsonReader>
</Reader>
<SortInfo Field="order_id" Direction="DESC" />
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnId="orderid" Header="Order ID" DataIndex="order_id" />
<ext:Column Header="description" DataIndex="description" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
</SelectionModel>
<Plugins>
<ext:RowExpander ID="RowExpander1" runat="server" EnableCaching="true">
<Component>
<ext:Panel runat="server" Border="false" Padding="10">
<Items>
<ext:Panel runat="server" Padding="5" Border="false" Cls="cb-cell2">
<Items>
<ext:TableLayout ID="TableLayout2" runat="server">
<Cells>
<ext:Cell>
<ext:Button ID="btnApprove" Text="Approve" Icon="Tick" runat="server">
<DirectEvents>
<Click OnEvent="approveOrder(#{RowEditor1}.record)">
<EventMask ShowMask="true" MinDelay="1000" Target="CustomTarget" CustomTarget="={GridPanel1.body}" />
</Click>
</DirectEvents>
</ext:Button>
</ext:Cell>
<ext:Cell>
<ext:Button ID="btnCancel" Text="Cancel" Icon="Cross" runat="server"></ext:Button>
</ext:Cell>
</Cells>
</ext:TableLayout>
</Items>
</ext:Panel>
</Items>
</ext:Panel>
</Component>
<DirectEvents>
<BeforeExpand OnEvent="getOrder">
<EventMask ShowMask="true" MinDelay="1000" Target="CustomTarget" CustomTarget="={GridPanel1.body}" />
<ExtraParams>
<ext:Parameter Name="id" Value="record.id" Mode="Raw" />
</ExtraParams>
</BeforeExpand>
</DirectEvents>
</ext:RowExpander>
</Plugins>
<LoadMask ShowMask="true" />
</ext:GridPanel>