0 Replies Latest reply on Nov 22, 2008 10:10 PM by Smart_flex

    Need help with data grid hierarchy data

    Smart_flex
      Hello, I am very new to flex, I really appreciate help on this. I am trying to display hierarchy data in the data grid. I have below structured ArrayCollection which is working like charm..How can I build same structure in Java using ArrayList or Java Collection interfaces. Can you please let me know how I can build the java objects (Region object etc...) to represent hierarchy data in the data grid. Thanks in advance.

      Ex:

      private var dpHierarchy:ArrayCollection = new ArrayCollection([
      {Region:"Arizona", children: [
      {Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000},
      {Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}]},
      {Region:"Central California", children: [
      {Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}]},
      {Region:"Nevada", children: [
      {Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}]},
      {Region:"Northern California", children: [
      {Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000},
      {Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}]},
      {Region:"Southern California", children: [
      {Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000},
      {Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000}]}

      ]);

      data grid:
      <mx:AdvancedDataGrid width="100%" id="adg1" height="90%">
      <mx:dataProvider>
      <mx:HierarchicalData source="{dpHierarchy}"/>
      </mx:dataProvider>
      ....
      ...