Skip navigation
valerioV
Currently Being Moderated

populate Tree control with array of generic object

Sep 4, 2006 6:53 AM

How can I populate my Tree control with an array of generic objects (associate to a remote object), without use a XML component?

Thanks in advance
 
Replies
  • Currently Being Moderated
    Sep 4, 2006 10:24 PM   in reply to valerioV
    Hi..

    var s:Array = new Array();
    s.push( {label:Name, data: data} );

    tree.dataProvider = s;

    Just populate it with as much data as you want.

    Best,

    Austin
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 5, 2006 6:29 AM   in reply to valerioV
    An example from the docs:

    [Bindable]
    public var fileSystemStructure:Object =
    {label:"mx", children: [
    {label:"Containers", children: [
    {label:"Accordian", children:[]},
    {label:"DividedBox", children: [
    {label:"BoxDivider.as", data:"BoxDivider.as"},
    {label:"BoxUniter.as", data:"BoxUniter.as"}]},
    {label: "Grid", children:[]}]},
    {label: "Controls", children: [
    {label: "Alert", data: "Alert.as"},
    {label: "Styles", children: [
    {label: "AlertForm.as", data:"AlertForm.as"}]},
    {label: "Tree", data: "Tree.as"},
    {label: "Button", data: "Button.as"}]},
    {label: "Core", children:[]}
    ]};
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points