开发者

Multiple update of values in a row in a Flex DataGrid or AdvancedDatagrid

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 posi开发者_如何学Pythonble 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,


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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜