Sep 23, 2009, 10:35 AM
Grid Panel SetValue of editor field
Hi,
I have a grid panel with numeric field (amount, price, totalprice), after changing the value of the price-field I want to set the value of the totalprice numeric field.
The Stores datasource contains a list of business objects ...*
I implemented an AjaxEvent like follows
<ext:Column DataIndex="Amount" ColumnID="Amount" Header="Amount" Width="75" Align="Right">
<Editor>
* <ext:NumberField ID="nfAmount" runat="server" FieldLabel="Menge" DecimalPrecision="2"
DecimalSeparator=",">
</ext:NumberField>
</Editor>
</ext:Column>
<ext:Column DataIndex="UnitPrice" ColumnID="UnitPriceNETBase" Header="Unit Price"
Width="75" Align="Right">
*<ext:NumberField ID="nfUnitPrice" runat="server" FieldLabel="UnitPrice" DecimalPrecision="2" DecimalSeparator=",">
<AjaxEvents>
* <Change OnEvent="SetTotalPrice" />
</AjaxEvents>
</ext:NumberField>
</Editor>
* <ext:Column DataIndex="TotalPrice" ColumnID="DiscountRate" Header="Total" Width="75"
Align="Right">
<Editor>
* <ext:NumberField ID="nfTotalPrice" runat="server" readonly="True" FieldLabel="TotalPrice" DecimalPrecision="2"
DecimalSeparator="," />
</Editor>
* </ext:Column>
*The Event is fired but the Column "TotalPrice" as well as the Numberfield "nfTotalPrice" does not show any value
protected void SetTotalPrice(object sender, AjaxEventArgs e) {
double amount = Double.Parse(this.nfAmount.Value.ToString());
double price = Double.Parse(this.nfUnitPrice.Value.ToString());
nfTotalPrice.SetValue = amount * price
}
What's wrong?