views:

10

answers:

1

How can i update multiple cells of the same row changing the value of a single cell of the same row ??

Example: id, height, weight, fat percentage, corporal mass. When i change one of the values in a row (except id of course) the corporal mass cell value must change using a formula like: (height/weight2)*fat percentage*100. Is this posible with Datagrid or AdvancedDatagrid in Flex ??

I tried using custom item renders and inserting actionscript code inside the datagrid with no good result.

Help please,

A: 

Make sure everything is [Bindable] and use BindingUtils.bindSetter on each of the involved items:

BindingUtils.bindSetter(updateCorpMass, this, ["data", "height"])l
BindingUtils.bindSetter(updateCorpMass, this, ["data", "weight"])l
BindingUtils.bindSetter(updateCorpMass, this, ["data", "fat"])l

public function set updateCorpMass(value:Number):void
{
    cMass = (height / weight2) * fat * 100;
}
Amarghosh