1

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>
Community
  • 1
  • 1
Torg Ishere
  • 11
  • 1
  • 2
  • I was hoping someone would have insight into applying itemrenderers to the parent node (depth="1") but as it turns out the problem was that I was not using the appropriate type of renderer. My GroupTitleItemrenderer was extending ProgrammaticSkin, not overriding data or validateNow. – Torg Ishere Dec 03 '12 at 22:43
  • I went ahead and tried something different and removed the columnIndex and columnSpan. I also used the same _groupItemRendererFactory for both depths. ` ` 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

0 Answers0