【问题标题】:Using button in AdvancedDataGrid [duplicate]在 AdvancedDataGrid 中使用按钮 [重复]
【发布时间】:2011-08-25 07:40:21
【问题描述】:

可能重复:
Buttons in AdvancedDataGrid in Flex

我希望将 AdvancedDataGrid 列中的数据显示为按钮。这意味着按钮的标签应该显示单元格用来显示的文本。这可以使用项目渲染器完成吗?该网格的数据提供者是一个数组,作为该列数据字段的数组键是“AppNo”。 这就是我使用 itemRenderer 设置按钮的方式 -

<mx:AdvancedDataGridColumn headerText="Application No" dataField="AppNo" width="120">
 <mx:itemRenderer>
   <mx:Component>
    <mx:Button/>
   </mx:Component>
 </mx:itemRenderer>     
</mx:AdvancedDataGridColumn>

我尝试使用 label="{array["AppNo"]}" 设置标签,但没有成功。 有什么线索吗??

【问题讨论】:

标签: apache-flex button label itemrenderer advanceddatagrid


【解决方案1】:
<mx:AdvancedDataGridColumn headerText="Application No" dataField="AppNo" width="120">
 <mx:itemRenderer>
   <mx:Component>
    <mx:Button label="{data.AppNo}"/>
   </mx:Component>
 </mx:itemRenderer>     
</mx:AdvancedDataGridColumn>

【讨论】:

    【解决方案2】:

    按照建议将标签标签添加到您的按钮组件将正常工作。

    <mx:AdvancedDataGridColumn headerText="Application No" dataField="AppNo" width="120">
     <mx:itemRenderer>
       <mx:Component>
        <mx:Button label=""/>
       </mx:Component>
     </mx:itemRenderer>     
    </mx:AdvancedDataGridColumn>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-26
      • 2021-08-31
      • 2014-07-24
      • 2011-09-11
      • 2016-12-09
      • 1970-01-01
      • 2021-12-24
      • 1970-01-01
      相关资源
      最近更新 更多