I guess the best way to explain my issue is to describe it in terms of the hierarchical XML data example on Livedocs.
Here, the XML is of the form
<Region Region="Arizona">
<Territory_Rep Territory_Rep="Barbara Jennings" Actual="38865" Estimate="40000"/>
<Territory_Rep Territory_Rep="Dana Binn" Actual="29885" Estimate="30000"/>
</Region>
However, the data I have is more like:
<Region Region="Arizona">
<Territory_Rep Territory_Rep="Barbara Jennings">
<Actual>38865</Actual>
<Estimate>40000</Estimate>
</Territory_Rep>
<Territory_Rep Territory_Rep="Dana Binn">
<Actual>29885</Actual>
<Estimate>30000</Estimate>
</Territory_Rep>
</Region>
And I would programmatically create the columns like so:
var cols:Array = [];
var adgColumn:AdvancedDataGridColumn = new AdvancedDataGridColumn();
adgColumn.headerText = "Rep Name";
adgColumn.dataField = "@Territory_Rep";
cols.push(adgColumn);
adgColumn = new AdvancedDataGridColumn();
adgColumn.headerText = "Actual";
adgColumn.dataField = "Actual";
cols.push(adgColumn);
adgColumn = new AdvancedDataGridColumn();
adgColumn.headerText = "Estimate";
adgColumn.dataField = "Estimate";
cols.push(adgColumn);
grid.columns = cols;
grid.validateNow();
However, this would result in the reps appearing as branch nodes (i.e. folders), with some empty leaf nodes underneath. This is clearly not what I want - I need it to still look as it does in the example.
Obviously I could solve this by writing some code - the simplest ways being to change the XML (be that at source, or with a parser in my Flex app), or to parse it then dump the required data into an ArrayCollection instead, but is there no way to get this to work out of the box? Given I've instructed the AdvancedDataGrid to use all the child elements on a single row, why can't it then ignore them from a hierarchy point of view?
Since the AdvancedDataGrid seems to have a few other annoying issues (e.g. question 3517769) is my best bet simply to create my own class that does everything I want it to? Or are there some decent workarounds that I'm not aware of?
Cheers.