Yes, best practice is to create a custom item renderer only if you need to display something more than a simple text string for each data item. That's because a custom renderer will typically involve additional DisplayObjects and therefore will take more memory and be slower.

 

 If all you want to do is make the string that the standard renderer displays be a computed value, use labelFunction.

 

- Gordon

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Karl Johnson
Sent: Wednesday, June 28, 2006 8:47 AM
To: [email protected]
Subject: RE: [flexcoders] Sum Column in datagrid

 

It might be easier to just set a labelFunction.

 

And then in the labelFunction

 

function getSum(rowData) : String

{

    var sum = Number(rowData.col1) + Number(rowData.col1); 

 

    return sum.toString();

}

 

 

That is flex 1.5...but you get the idea.

 

Karl

 

Cynergy Systems, Inc.

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Clint Tredway
Sent: Wednesday, June 28, 2006 10:23 AM
To: [email protected]
Subject: Re: [flexcoders] Sum Column in datagrid

most likely you would need to make an item renderer and have it sum those fields and display the result in the final column.

On 6/28/06, Torey Maerz < [EMAIL PROTECTED]> wrote:

What is the best way to add a column in a datagrid that is a sum of
other columns in the datagrid? For example add column C which is a sum
of A and B.

Thanks!




--
diabetic? http://www.diabetesforums.com
Bill Cosby - A word to the wise ain't necessary - it's the stupid ones that need the advice.

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to