我想捕获标题单击事件,单击时,我想通过在每个级别动态添加 AdvancedDatgridColumnGroup 来拆分列。这可行吗?至少帮助我捕获标题单击事件。请不要建议 OLAP 。我想更多地探索高级数据网格选项。
<mx:AdvancedDataGrid x="6" y="4" id="adg0" designViewDataType="flat" width="947" height="357" click="summaryViewStack.selectedIndex = 1" fontFamily="Verdana" fontSize="10">
<mx:groupedColumns>
<mx:AdvancedDataGridColumn headerText="Cluster" dataField="label" />
<mx:AdvancedDataGridColumnGroup headerText="Revenue" >
<mx:AdvancedDataGridColumn headerText="April" dataField="data1"/>
<mx:AdvancedDataGridColumn headerText="May" dataField="data2"/>
<mx:AdvancedDataGridColumn headerText="June" dataField="data3"/>
<mx:AdvancedDataGridColumn headerText="Q1" dataField="data4"/>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup headerText="Headcount" >
<mx:AdvancedDataGridColumn headerText="April" dataField="data1"/>
<mx:AdvancedDataGridColumn headerText="May" dataField="data2"/>
<mx:AdvancedDataGridColumn headerText="June" dataField="data3"/>
<mx:AdvancedDataGridColumn headerText="Q1" dataField="data4"/>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup headerText="Effort" >
<mx:AdvancedDataGridColumn headerText="April" dataField="data1"/>
<mx:AdvancedDataGridColumn headerText="May" dataField="data2"/>
<mx:AdvancedDataGridColumn headerText="June" dataField="data3"/>
<mx:AdvancedDataGridColumn headerText="Q1" dataField="data4"/>
</mx:AdvancedDataGridColumnGroup>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
</mx:Canvas>
<mx:Canvas label="Accountwise Summary" width="100%" height="100%">
<mx:AdvancedDataGrid x="6" y="4" id="adg1" designViewDataType="flat" width="947" height="357" click="summaryViewStack.selectedIndex = 1" fontFamily="Verdana" fontSize="10">
<mx:dataProvider>
<mx:ArrayCollection>
<mx:Object label="1800-Flowers" data1="20" data2="30" data3="40" data4="90" />
<mx:Object label="The Home Depot" data1="20" data2="30" data3="40" data4="90" />
<mx:Object label="Nielsen" data1="20" data2="30" data3="40" data4="90" />
<mx:Object label="Nokia" data1="20" data2="30" data3="40" data4="90" />
</mx:ArrayCollection>
</mx:dataProvider>
<mx:groupedColumns>
<mx:AdvancedDataGridColumn headerText="Account" dataField="label"/>
<mx:AdvancedDataGridColumnGroup headerText="Revenue" >
<mx:AdvancedDataGridColumn headerText="April" dataField="data1"/>
<mx:AdvancedDataGridColumn headerText="May" dataField="data2"/>
<mx:AdvancedDataGridColumn headerText="June" dataField="data3"/>
<mx:AdvancedDataGridColumn headerText="Q1" dataField="data4"/>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup headerText="Headcount" >
<mx:AdvancedDataGridColumn headerText="April" dataField="data1"/>
<mx:AdvancedDataGridColumn headerText="May" dataField="data2"/>
><mx:AdvancedDataGridColumn headerText="June" dataField="data3"/>
<mx:AdvancedDataGridColumn headerText="Q1" dataField="data4"/>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup headerText="Effort" >
<mx:AdvancedDataGridColumn headerText="April" dataField="data1"/>
<mx:AdvancedDataGridColumn headerText="May" dataField="data2"/>
<mx:AdvancedDataGridColumn headerText="June" dataField="data3"/>
<mx:AdvancedDataGridColumn headerText="Q1" dataField="data4"/>
</mx:AdvancedDataGridColumnGroup></mx:groupedColumns>
</mx:AdvancedDataGrid>