【问题标题】:Flex Datagrid item renderer DateField, Combobox Issue help !Flex Datagrid 项目渲染器 DateField、Combobox 问题求助!
【发布时间】:2011-08-16 11:57:23
【问题描述】:

1) 在flex中使用datefield作为item渲染器

我正在动态创建数据网格及其列。喜欢

dataGridColumn=new DataGridColumn();
dataGridColumn.dataField="invoiceDTO.invoiceDate";// I read this value from XML
dataGridColumn.editorDataField="selectedDate";
dataGridColumn.itemRenderer=new ClassFactory(DateFieldRenderer);
dataGridColumn.rendererIsEditor=true;

但是当生成 UI 时,我收到错误 invoiceDTO.invoiceDate not found on the TestDTO

//Test DTO

public class TestDTO
{
 public var invoiceDTO:InvoiceDTO;
}              

我的目标是我的 dataField 应该与 datagrid 中的 datafield 绑定。我如何在 actionscript 中做到这一点

2) 我需要将组合框呈现为项目渲染器。 (与案例 1 相同)。但是我如何在 数据网格中存在的组合框。

仅供参考,这需要在 actionscript 中完成

【问题讨论】:

    标签: apache-flex datagrid itemrenderer


    【解决方案1】:

    关于问题的第一部分。您不能在dataField 参数中使用复杂的表达式。要显示自定义标签,最好使用labelFunction

    第二部分你应该阅读official documentation。有一个创建自定义 ActionScript 项呈现器的示例。简而言之,您可以在项目渲染器中操作data 属性来访问数据提供者的当前元素。

    【讨论】:

      猜你喜欢
      • 2010-11-06
      • 1970-01-01
      • 1970-01-01
      • 2011-07-26
      • 1970-01-01
      • 2011-08-31
      • 2011-03-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多