I have this spark DataGrid with five c开发者_如何学Goolumns. my third and fourth columns represent amount (of product ordered) and price (of a unit of the product). My issue now is to set the fifth column equal to price*amount. I can't seem to find a way to do this. anyone? thank you.
I assume that amount and price are stored in the objects that populate your DataGrid.
Just create a custom itemRenderer for the fifth column. In the dataChange event calculate the value. Conceptually something like this:
protected function onDataChange(event:Event):void{
myDisplayField.text = (data.amount*data.price).toString();
}
More info on creating custom renderers.
精彩评论