簡體   English   中英

Flex Datagrid 項目渲染器 DateField, Combobox 問題幫助!

[英]Flex Datagrid item renderer DateField, Combobox Issue help !

1) 在 flex 中使用 datefield 作為項目渲染器

我正在動態創建數據網格及其列。 喜歡

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

我的目標是我的數據字段應該與數據網格內的數據字段綁定。我如何在 actionscript 中做到這一點

2) 我需要提供 combobox 作為項目渲染器。 (與案例 1 相同)。 但是我如何在數據網格中存在的 combobox 中分配數據提供者。

僅供參考,這需要在 actionscript 中完成

關於問題的第一部分。 您不能在dataField參數中使用復雜的表達式。 要顯示自定義 label 最好使用labelFunction

第二部分怎么樣,你應該閱讀官方文檔 有一個創建自定義 ActionScript 項目渲染器的示例。 簡而言之,您可以在項目渲染器中操作data屬性以訪問數據提供者的當前元素。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM