【问题标题】:Multiple update of values in a row in a Flex DataGrid or AdvancedDatagrid多次更新 Flex DataGrid 或 AdvancedDatagrid 中的一行中的值
【发布时间】:2011-03-16 03:37:45
【问题描述】:

如何更新同一行的多个单元格以更改同一行的单个单元格的值?

示例:身份证、身高、体重、脂肪百分比、体重。当我连续更改其中一个值时(当然除了 id),身体质量单元格值必须使用如下公式更改:(身高/体重2)*脂肪百分比*100。这对 Flex 中的 Datagrid 或 AdvancedDatagrid 是否可行??

我尝试使用自定义项目渲染并在数据网格中插入动作脚本代码,但没有得到很好的结果。

请帮忙,

【问题讨论】:

    标签: actionscript-3 datagrid flex3 advanceddatagrid


    【解决方案1】:

    确保所有内容都是[Bindable],并在每个涉及的项目上使用BindingUtils.bindSetter

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-01
      • 1970-01-01
      • 2011-02-21
      • 2012-12-04
      • 2011-07-08
      相关资源
      最近更新 更多