Mar 20, 2012, 1:50 PM
get value of hidden column with command onevent
Hello I have a hidden column batchid, next to it is a commandcolumn with a button.
Upon click I want to show the value of the cell (in column batchid same row).
This is what I have, it won't even show on the screen.
test.aspx
Upon click I want to show the value of the cell (in column batchid same row).
This is what I have, it won't even show on the screen.
test.aspx
<ext:GridPanel ID="grid" runat="server" Title="" AutoWidth="true" AutoHeight="true"
Padding="4" StripeRows="true" Draggable="false" Selectable="true">
<Store>
<ext:Store ID="Store1" runat="server" WarningOnDirty="false">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="batchid" Mapping="batchid" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column DataIndex="batchid" Header="BatchID" Width="100" Hidden="true">
</ext:Column>
<ext:CommandColumn>
<Commands>
<ext:GridCommand Icon="Cancel" CommandName="Cancel" Text="Cancel" Hidden="true">
</ext:GridCommand>
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="false" />
</SelectionModel>
<DirectEvents>
<Command OnEvent="btnCancel">
<ExtraParams>
<%-- get value batchid --%>
<ext:Parameter Name="batchid" Value="function(record){return record.get('batchid).value;}" Mode="Raw">
</ext:Parameter>
</ExtraParams>
</Command>
</DirectEvents>
</ext:GridPanel>
test.aspx.cs[DirectMethod]
protected void btnCancel(Object sender, DirectEventArgs e)
{
// show the value
string test = e.ExtraParams["batchid"];
ExtNet.MessageBox.Show(new MessageBoxConfig
{
Buttons = MessageBox.Button.OK,
Icon = MessageBox.Icon.ERROR,
Title = "Test",
Message = test
});
}