1 Reply Latest reply on Apr 29, 2010 5:48 AM by cjolif-Fc6gNO

    [Elixir OrgChart ]col.addChild is not working correctly (bug?)

    esrefatak Level 1

      Where is the problem? Why child "Esref" is not appears in chart?

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:ilog="http://www.ilog.com/2007/ilog/flex"
      >
      <mx:Script>
      <![CDATA[
      import mx.collections.IHierarchicalCollectionView;
      import mx.collections.HierarchicalCollectionView;
      import ilog.orgchart.*;

       

      Bindable
      private var xml:XML =
      <person uid="1" name="Marion Daignan" isBranch="true" email="mdaignan@mycompany.com" phone="4155550012" mobilePhone="4155550013" fax="4155550014" instantMessager="mdaignan" position="PrincipalArchitect" location="San Francisco" businessUnit="R&D" timeZone="GMT-8" presenceIndicator="sick" >
      </person>;

       

      private function btnAddParent_click(event:Event):void{
      var col:IHierarchicalCollectionView = chart.dataProvider as IHierarchicalCollectionView;

       

      col.addChild(xml, <person uid="2" name="Pierre Brenkle" isBranch="true" email="pbrenkle@mycompany.com" phone="4155550015" mobilePhone="4155550016" fax="4155550017" instantMessager="pbrenkle" position="Architect" location="San Francisco" businessUnit="R&D" timeZone="GMT-8" presenceIndicator="vacation" >
      <person uid="3" name="Marianne Beach" isBranch="true" email="mbeach@mycompany.com" phone="4155550018" mobilePhone="4155550019" fax="4155550020" instantMessager="mbeach" position="Developer" location="San Francisco" businessUnit="R&D" timeZone="GMT-8" presenceIndicator="present" >
      <person uid="4" name="Anne Caretta" isBranch="true" email="acaretta@mycompany.com" phone="4155550021" mobilePhone="4155550022" fax="4155550023" instantMessager="acaretta" position="Developer" location="San Francisco" businessUnit="R&D" timeZone="GMT-8" presenceIndicator="unknown" />
      <person uid="5" name="Jacob Boute" isBranch="true" email="jboute@mycompany.com" phone="4155550024" mobilePhone="4155550025" fax="4155550026" instantMessager="jboute" position="Developer" location="San Francisco" businessUnit="R&D" timeZone="GMT-8" presenceIndicator="present">
      <person uid="99" name="Esref" isBranch="true" email="favila@mycompany.com" phone="4155550036" mobilePhone="4155550037" fax="4155550038" instantMessager="favila" position="Developer" location="San Francisco" businessUnit="R&D" timeZone="GMT-8" presenceIndicator="present" >
      <person uid="100" name="Kemal" isBranch="true" email="vbonche@mycompany.com" phone="4155550039" mobilePhone="4155550040" fax="4155550041" instantMessager="vbonche" position="Developer" location="San Francisco" businessUnit="R&D" timeZone="GMT-8" presenceIndicator="travel"/>
      </person>
      </person>
      </person>
      <person uid="9" name="Francis Avila" isBranch="true" email="favila@mycompany.com" phone="4155550036" mobilePhone="4155550037" fax="4155550038" instantMessager="favila" position="Developer" location="San Francisco" businessUnit="R&D" timeZone="GMT-8" presenceIndicator="present" >
      <person uid="10" name="Vitta Bonche" isBranch="true" email="vbonche@mycompany.com" phone="4155550039" mobilePhone="4155550040" fax="4155550041" instantMessager="vbonche" position="Developer" location="San Francisco" businessUnit="R&D" timeZone="GMT-8" presenceIndicator="travel"/>
      </person>
      </person>);

       

      }

      ]]>
      </mx:Script>
      <mx:Button label="Add Parent" click="btnAddParent_click(event);" width="159"/>
      <ilog:OrgChart id="chart" dataProvider="{xml}" animationDuration="3000" width="100%" height="100%"/>

       

      </mx:Application>