Flex Datagrid item renderer DateField, Combobox Issue help !
1) Using datefield as item renderer in flex
I am dynamically creating datagrid and its columns. like
dataGridColumn=new DataGridColumn();
dataGridColumn.dataField="invoiceDTO.invoiceDate";// I read this value from XML
dataGridColumn.editorDataField="selectedDate";
dataGridColumn.itemRenderer=new ClassFactory(DateFieldRenderer);
dataGridColumn.rendererIsEditor=true;
But when UI is generated i get the error invoiceDTO.invoiceDate not found on the TestDTO
//Test DTO
public class TestDTO
{
public var invoiceDTO:InvoiceDTO;
}
My objective is my dataField should be binded with datafield inside the datagrid.How can i do it in actionscript
2) I need to present combo开发者_如何学编程box as item renderer. (same like case 1). But how can i assign dataprovider in the combobox which is present inside the datagrid.
FYI this needs to be done in actionscript
About the first part of question. You can't use complex expressions in dataField
parameter. To display a custom label it is better to use labelFunction
.
What about the second part you should read official documentation. There is a sample of creating custom ActionScript item renderers. To be short you can operate data
property within item renderer to have access to a current element of data provider.
精彩评论