将项呈示器应用于Flex Advanceddatagrid

时间:2012-12-03 22:19:36

标签: flex flex3 advanceddatagrid flash-builder4.5 itemrenderers

我正在尝试将自定义项呈示器应用于Flex AdvancedDataGrid。我现在通过在父节点@ depth =“1”上应用一个纯黑色方块来测试。黑色方块不是最终的项目渲染器,我只是想确保我可以将自定义项目渲染器应用于父节点。最终产品将有一些获取样式和使用绘图APi绘制的背景皮肤。

...参考 见this

请参阅"Using item renderers with the AdvancedDataGrid control"

请参阅Adobe language Ref

示例#1 - 这应该将_groupItemRendereFactory应用于列,并将GroupTitleRenderer应用于 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" itemRenderer="{ _groupItemRendererFactory }" />
        </mx:columns>
        <mx:rendererProviders>
            <mx:AdvancedDataGridRendererProvider columnIndex="1" columnSpan="1" depth="1" renderer="com.theme.skins.GroupTitleItemRenderer"/>
        </mx:rendererProviders>
    </mx:AdvancedDataGrid></code>

0 个答案:

没有答案