views:

187

answers:

1

I have a JSON decoded array of Projects which contain a nested array of Milestones. I'm trying to display the Milestones one at a time inside a Datagrid. However, it seem Datagrid can't handle more than 1 level of data. Following is a simple diagram of what I'm trying to do.

[Project Name [0]]  [Milestone[0]]
[Project Name [1]]  [Milestone[0]]

15 seconds later...

[Project Name [0]]  [Milestone[1]]
[Project Name [1]]  [Milestone[1]]

I also tried solving the problem using TileList but I'm having problem accessing the inner component.

<mx: Tilelist id="projects">
    <mx: itemRender>
        <mx: component>
           <mx: HBox>
              <mx: Text id="milestone">

If I try projects.milestones I would get an undefined function error.

A: 

OK I worked out a solution. I added an int counter to the decoded JSON array to keep track of the nested array of Milestones. I then use a Timer to advance the int counter one at a time and InvalidList the Datagrid to refresh the data. The DataGridColumn use LabelFunction to return the particular array element.

MooCow