2011-05-01 59 views
0

1)在flex中使用datefield作爲項目渲染器Flex Datagrid項目渲染器DateField,Combobox問題幫助!

我在動態創建數據網格及其列。像

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不上TestDTO發現錯誤

//Test DTO 

public class TestDTO 
{ 
public var invoiceDTO:InvoiceDTO; 
}    

我的目標是我的dataField應與datagrid.How我可以做內部的數據字段進行綁定它在動作

2)我需要呈現combobox作爲項目渲染器。 (與案例1相同)。但是,我怎樣才能在數據網格中存在的 組合框中指定數據提供者。

僅供參考這需要在動作中完成

回答

0

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

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