In general, you want to store/cache data in the data objects.  I would
have some sort of getter for totalQty that knows it hasn't been
calculated yet.
 
private var _totalQty:int = -1;
public function get totalQty():int
{
    if (_totalQty < 0)
        _totalQty = goAddItUp();
 
    return _totalQty;
}

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of j_lentzz
Sent: Monday, December 10, 2007 8:17 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to get labelFunction to affect multiple
columns



Hi,

I've got a datagrid where I want to display the total quantity of
items on the row and the total price of all the items on the row. 
I've tried having separate labelFunctions for each column, but I'm
starting to see performance issues. Since the total price calculates
the total quantity, I was wanting to just use that in the total
quantity column in stead of a separate labelFunction. I've tried
setting rowData["totalQty"] in the total price labelFunction, and it
almost works. It doesn't show the totalQty value when the current
row's total price labelFunction is called, but shows the total qty
after the row is touched again, or after another row is added. Is
there a way to force it to use the new totalQty when it is calculated
in the Total Price labelFunction? So that when a row is added, both
the total qty and total price values will appear?

Thanks,

John



 

Reply via email to