1 Reply Latest reply on Sep 14, 2006 1:09 AM by valerioV

    How to insert visual components in a Tree at runtime

    valerioV Level 1

      I want to insert a button or a linkButton in a Tree row at runtime.
      A row in my data provider array is structured as follows:

      {label:retrievedSQLdata.name, icon:ingObj[ retrievedSQLdata.type ], data:retrievedSQLdata}

      I have thought to insert my visual component in this way:

      if(retrievedSQLdata.type=='phone') {
      var myButton = new Button();
      myTreeArray.addItem({label:retrievedSQLdata.name, icon:ingObj[ retrievedSQLdata.type ], data:retrievedSQLdata,
      <mx:Tree dataProvider="{myTreeArray}" ... />

      ofcourse it doesn't work.