Note that there are some explanatory texts on larger screens.

plurals
  1. POFlex AdvancedDataGrid HierarchicalData XML results in unwanted rows
    primarykey
    data
    text
    <p>I guess the best way to explain my issue is to describe it in terms of the <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_07.html#245224" rel="nofollow noreferrer">hierarchical XML data example on Livedocs</a>.</p> <p>Here, the XML is of the form</p> <pre><code>&lt;Region Region="Arizona"&gt; &lt;Territory_Rep Territory_Rep="Barbara Jennings" Actual="38865" Estimate="40000"/&gt; &lt;Territory_Rep Territory_Rep="Dana Binn" Actual="29885" Estimate="30000"/&gt; &lt;/Region&gt; </code></pre> <p>However, the data I have is more like:</p> <pre><code>&lt;Region Region="Arizona"&gt; &lt;Territory_Rep Territory_Rep="Barbara Jennings"&gt; &lt;Actual&gt;38865&lt;/Actual&gt; &lt;Estimate&gt;40000&lt;/Estimate&gt; &lt;/Territory_Rep&gt; &lt;Territory_Rep Territory_Rep="Dana Binn"&gt; &lt;Actual&gt;29885&lt;/Actual&gt; &lt;Estimate&gt;30000&lt;/Estimate&gt; &lt;/Territory_Rep&gt; &lt;/Region&gt; </code></pre> <p>And I would programmatically create the columns like so:</p> <pre><code>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(); </code></pre> <p>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.</p> <p>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?</p> <p>Since the AdvancedDataGrid seems to have a few other annoying issues (e.g. <a href="https://stackoverflow.com/questions/3517769/advancedatagrid-nodes-collapse-on-refresh">question 3517769</a>) 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?</p> <p>Cheers.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload