Tracy is right, you should use an itemRenderer for this.
calculatedValueRenderer should override the data method (like all good
little renderers do :)) and in the method retrieve the values to be
calculated as well as updating the calculated value in the
dataProvider. Using the ClassFactory approach that we've discussed,
apossible properties property may look something like this:
myCalcFactory.properties = {sourceFieldA: "quantity", sourceFieldB:
"price", totalField: "totalItemPrice"};
HTH,
Ben
--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> I don't think labelFunction is intended to update the dataProvider. I
> don't see how it possibly could, since it can use multiple columns and
> does not even have to have a dataProvider property associated with it.
>
>
>
> If you want this, I heard of a technique that uses a custom item object,
> with calculated properties like that built in, and when result data is
> received, one loops over the raw data creating custom objects for each,
> and assigning them to the dataProvider. This also lets you use
> labelFunction to change the way the data is displayed, without messing
> up the underlying data. Currency formatting, for example.
>
>
>
> Just brainstorming.
>
>
>
> Tracy
>
>
>
> ________________________________
>
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of bsdensmore
> Sent: Wednesday, November 29, 2006 5:23 PM
> To: [email protected]
> Subject: [flexcoders] Can't get value after labelfunction
>
>
>
> I have 2 DataGridColumns that use a labelfunction to multiply a couple
> of fields and display the value in another column. For some reason
> after the field is updated with the total I can't get at that value.
>
> The dataProvider that the DataGrid is bound to is a query result that
> is converted to an ArrayCollection. When the ArrayCollection is
> initially populated this field is blank. So, I'm guessing that after
> the labelfunction executes it doesn't update the ArrayCollection to
> hold the newly calculated value?
>
> How can I go about updating the ArrayCollection so I can save it to a
> database table. I swear I had this working.
>
> Thanks,
> Ben
>