Hi Friends,
I am trying to create a hierarchical AdvancedDataGrid with a column which is a
ComboBox renderer. I used this renderer in other table which is not a
hierarchical one and it works perfect. But in the hierarchical data grid, for
some reason the combobox is not working. Attached is a screen shot of the panel
(the last column is the one which has the combobox renderer).
I also noticed that the grouping columns also not working in the hierarchical
datagrid.
Please let me know if you have any suggestions. Thanks a lot in advance.
Patricia Han
Here's the source code,
[Bindable]
private var
hierarchicalTablData:Object =
{chassis_card:"Chassis-lab", Summary:"true", children: new
ArrayCollection([
{chassis_card: "Card1",
s_capacity:"700MB", target:"chs1/card1",children: new
ArrayCollection([
{chassis_card:
"100MBvNIC", Summary:"true", cardType:"1GB",
s_capacity:"100MB"},
{chassis_card:
"200MBvNIC", cardType:"1GB",
s_capacity:"200MB"}])},
{chassis_card:"Card2",
s_capacity:"400MB",target:"chs1/card1",Summary:"false",
children: new ArrayCollection([
{chassis_card:"100MBvNIC", cardType:"1GB",
s_capacity:"100MB", attributes:"Read Only"},
{chassis_card:"500MBvNIC",
Summary:"true", cardType:"1GB",
s_capacity:"500MB"}])},
{chassis_card:
"Card3",
s_capacity:"800MB",target:"chs1/card1",children: new
ArrayCollection([
{chassis_card:
"200MB", cardType:"1GB", s_capacity:"200MB"},
{chassis_card:
"Card4",
s_capacity:"7GB",target:"chs1/card1",children: new
ArrayCollection([
{chassis_card:
"1GBvNIC", cardType:"10GB", s_capacity:"1GB"},
{chassis_card:
"2GBvNIC", cardType:"10GB",
s_capacity:"2GB"}])}])}
])};
<mx:AdvancedDataGrid id="adg" dataProvider="{new
HierarchicalData(hierarchicalTablData)}" width="100%"
height="445">
<mx:columns>
<mx:AdvancedDataGridColumn dataField="chassis_card"
headerText="Source Chassis/IO Module" />
<mx:AdvancedDataGridColumn dataField="cardType"
headerText="Card Type"/>
<mx:AdvancedDataGridColumn
dataField="s_capacity" headerText="Capacity" />
<mx:AdvancedDataGridColumn dataField="target"
headerText="Target IO Resources" editable="true"
editorDataField="value" >
<mx:itemEditor>
<mx:Component>
<mx:ComboBox editable="true">
<mx:dataProvider>
<mx:String>chs1/card1</mx:String>
<mx:String>chs2/card2</mx:String>
<mx:String>chs2/card2</mx:String>
<mx:String>chs3/card1</mx:String>
<mx:String>chs3/card1</mx:String>
</mx:dataProvider>
</mx:ComboBox>
</mx:Component>
</mx:itemEditor>
</mx:AdvancedDataGridColumn>
</mx:columns>
</mx:AdvancedDataGrid>