I'm trying to apply a custom item renderer to a Flex AdvancedDataGrid. I'm testing right now by applying a solid black square to the parent nodes @ depth="1". The black square is not the final item renderer, I just want to make sure I can apply a custom item renderer to the parent nodes. The end product will have a few get styles and a background skin drawn using the drawing APi.
References... See this!
See "Using item renderers with the AdvancedDataGrid control"!
See Adobe language Ref!
Example #1 - This should apply the _groupItemRendereFactory to the columns, and apply the GroupTitleRenderer to the any column at depht="1"
<mx:dataProvider>
<mx:HierarchicalCollectionView id="foldersView">
<mx:source>
<mx:HierarchicalData id="foldersData" source="{ model.folders }" childrenField="profiles" />
</mx:source>
</mx:HierarchicalCollectionView>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn id="column" dataField="name" headerText="Name" itemRenderer="{ _groupItemRendererFactory }" />
</mx:columns>
<mx:rendererProviders>
<mx:AdvancedDataGridRendererProvider columnIndex="1" columnSpan="1" depth="1" renderer="com.theme.skins.GroupTitleItemRenderer"/>
</mx:rendererProviders>
</mx:AdvancedDataGrid></code>
Example #2 - Here I'm trying to specify which item renderer to use at which depth.
<mx:dataProvider>
<mx:HierarchicalCollectionView id="foldersView">
<mx:source>
<mx:HierarchicalData id="foldersData" source="{ model.folders }" childrenField="profiles" />
</mx:source>
</mx:HierarchicalCollectionView>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn id="column" dataField="name" headerText="Name"/>
</mx:columns>
<mx:rendererProviders>
<mx:AdvancedDataGridRendererProvider columnIndex="1" columnSpan="1" depth="1" renderer="com.themes.skins.GroupTitleItemRenderer"/>
<mx:AdvancedDataGridRendererProvider columnIndex="1" columnSpan="1" depth="2" renderer="{ _groupItemRendererFactory }"/>
</mx:rendererProviders>
</mx:AdvancedDataGrid></code>
` this seemed to work as expected. I'm now showing the same item renderer for each depth. I think I solved my question.– Torg Ishere Dec 03 '12 at 22:48