Re: [flexcoders] Re: Tree and array data

2008-12-21 Thread Pat Buchanan
Dan

Glad you got it figured out.  Could you post your solution here for future
searchers?

Thank you!

On Fri, Dec 19, 2008 at 4:29 PM, Dan Vega  wrote:

>   nm..im a dummy! got it
>
>
> On Fri, Dec 19, 2008 at 3:06 PM, Dan Vega  wrote:
>
>> I think I am finally getting some where. In case you don't know what I
>> have been up to I will bring you up to speed. I am building a file explorer
>> where the left side will only be directories. When you select a directory
>> the contents (files) will show up in a datagrid on the right. I was having
>> some issue with display branches but I solved that by inserting an empty
>> array on any folder i knew had children.
>>
>> Now I am trying to append the directories when the user starts drilling
>> down. So first I have an onItemOpen() method for when the folder is opened.
>> All this does is figure out the path and call my server side function that
>> will retrieve me a list of directories for a given path.
>>
>> private function onItemOpen(event:TreeEvent):void {
>> var path:String = event.item.path;
>> FileManager.getDirectories(path);
>> }
>>
>> I have a onResult method for the getDirectories() method called
>> listDirectories(). What I am doing here is
>>
>> 1. getting the list of directories.
>> 2. if the tree data provider (_directorheies) is null we know this is the
>> base.
>> 3. if not I am trying to figure out a way to append this array (or swap
>> out) with the children empty array i have as a placeholder.
>>
>> Is this the right approach? I am obviously doing something wrong, hope
>> someone can point that out!
>>
>> private function listDirectories(event:ResultEvent):void {
>> var dirs:Array = event.result as Array;
>> var parent:String = dirs[0].parent;
>> var pos:uint = -1;
>>
>> // if the _directories array is null this is our root
>> request
>> if(_directories == null) {
>> _directories = dirs;
>> }else {
>> // we know the parent of the item that was clicked,
>> find the array position
>> for(var i in _directories){
>> if(_directories[i].path == parent){
>> pos = i;
>> break;
>> }
>> }
>> //if we found the position append the directories to
>> the children node
>> _directories[i].children = dirs;
>> trace(ObjectUtil.toString(_directories));
>> }
>> }
>>
>>
>>
>>
> 
>


Re: [flexcoders] Re: Tree and array data

2008-12-19 Thread Dan Vega
nm..im a dummy! got it


On Fri, Dec 19, 2008 at 3:06 PM, Dan Vega  wrote:

> I think I am finally getting some where. In case you don't know what I have
> been up to I will bring you up to speed. I am building a file explorer where
> the left side will only be directories. When you select a directory the
> contents (files) will show up in a datagrid on the right. I was having some
> issue with display branches but I solved that by inserting an empty array on
> any folder i knew had children.
>
> Now I am trying to append the directories when the user starts drilling
> down. So first I have an onItemOpen() method for when the folder is opened.
> All this does is figure out the path and call my server side function that
> will retrieve me a list of directories for a given path.
>
> private function onItemOpen(event:TreeEvent):void {
> var path:String = event.item.path;
> FileManager.getDirectories(path);
> }
>
> I have a onResult method for the getDirectories() method called
> listDirectories(). What I am doing here is
>
> 1. getting the list of directories.
> 2. if the tree data provider (_directorheies) is null we know this is the
> base.
> 3. if not I am trying to figure out a way to append this array (or swap
> out) with the children empty array i have as a placeholder.
>
> Is this the right approach? I am obviously doing something wrong, hope
> someone can point that out!
>
> private function listDirectories(event:ResultEvent):void {
> var dirs:Array = event.result as Array;
> var parent:String = dirs[0].parent;
> var pos:uint = -1;
>
> // if the _directories array is null this is our root
> request
> if(_directories == null) {
> _directories = dirs;
> }else {
> // we know the parent of the item that was clicked,
> find the array position
> for(var i in _directories){
> if(_directories[i].path == parent){
> pos = i;
> break;
> }
> }
> //if we found the position append the directories to
> the children node
> _directories[i].children = dirs;
> trace(ObjectUtil.toString(_directories));
> }
> }
>
>
>
>


Re: [flexcoders] Re: Tree and array data

2008-12-19 Thread Dan Vega
I think I am finally getting some where. In case you don't know what I have
been up to I will bring you up to speed. I am building a file explorer where
the left side will only be directories. When you select a directory the
contents (files) will show up in a datagrid on the right. I was having some
issue with display branches but I solved that by inserting an empty array on
any folder i knew had children.

Now I am trying to append the directories when the user starts drilling
down. So first I have an onItemOpen() method for when the folder is opened.
All this does is figure out the path and call my server side function that
will retrieve me a list of directories for a given path.

private function onItemOpen(event:TreeEvent):void {
var path:String = event.item.path;
FileManager.getDirectories(path);
}

I have a onResult method for the getDirectories() method called
listDirectories(). What I am doing here is

1. getting the list of directories.
2. if the tree data provider (_directorheies) is null we know this is the
base.
3. if not I am trying to figure out a way to append this array (or swap out)
with the children empty array i have as a placeholder.

Is this the right approach? I am obviously doing something wrong, hope
someone can point that out!

private function listDirectories(event:ResultEvent):void {
var dirs:Array = event.result as Array;
var parent:String = dirs[0].parent;
var pos:uint = -1;

// if the _directories array is null this is our root
request
if(_directories == null) {
_directories = dirs;
}else {
// we know the parent of the item that was clicked, find
the array position
for(var i in _directories){
if(_directories[i].path == parent){
pos = i;
break;
}
}
//if we found the position append the directories to the
children node
_directories[i].children = dirs;
trace(ObjectUtil.toString(_directories));
}
}


Re: [flexcoders] Re: Tree and array data

2008-12-19 Thread ivo
The Tree has styling for disclosure icons & folder icons. If you want 
additional or different visual controls you will most likely need
to extend the TreeItemRenderer class and set it in the tree's
itemrenderer property. You can override the createChildren() function
to add any visual controls that can be toggled on/off based on values
in the node data object, like if your node object has a 'loading' attribute you 
can use it to toggle a loading animation.

- Ivo





From: Cato Paus 
To: flexcoders@yahoogroups.com
Sent: Friday, December 19, 2008 6:10:56 AM
Subject: [flexcoders] Re: Tree and array data


bind the isBranch = {yourobject. haschilderen}
or create your own TreeDataDescriptor by implemnting the 
ITreeDataDescriptor interface

--- In flexcod...@yahoogro ups.com, "Dan Vega"  wrote:
>
> I don't think its just icon though is it? It needs to be a branch 
with an
> arrow next to it so that you can click on it to expand the folder.
> 
> Thank You
> Dan Vega
> danv...@...
> http://www.danvega. org
> 
> 
> On Thu, Dec 18, 2008 at 2:43 PM, Fotis Chatzinikos <
> fotis.chatzinikos@ ...> wrote:
> 
> >   use iconFunction= "yourFunction( )" where yourfunction checks 
your isLeaf
> > variable and assigns a folder or leaf icon
> >
> >
> > On Thu, Dec 18, 2008 at 9:07 PM, Dan Vega  wrote:
> >
> >>   but not every folder will be a branch, only those who have 
children. I
> >> can set the default leaf icon to a standar folder but I am stuck 
on how to
> >> treat branches using my example.
> >>
> >>
> >
> >
> > --
> > Fotis Chatzinikos, Ph.D.
> > Founder,
> > Phinnovation
> > Fotis.Chatzinikos@ ...,
> > 
> >
>



[flexcoders] Re: Tree and array data

2008-12-19 Thread Cato Paus
bind the isBranch = {yourobject.haschilderen}
 or create your own TreeDataDescriptor by implemnting the 
ITreeDataDescriptor interface




--- In flexcoders@yahoogroups.com, "Dan Vega"  wrote:
>
> I don't think its just icon though is it? It needs to be a branch 
with an
> arrow next to it so that you can click on it to expand the folder.
> 
> Thank You
> Dan Vega
> danv...@...
> http://www.danvega.org
> 
> 
> On Thu, Dec 18, 2008 at 2:43 PM, Fotis Chatzinikos <
> fotis.chatzini...@...> wrote:
> 
> >   use iconFunction="yourFunction()" where yourfunction checks 
your isLeaf
> > variable and assigns a folder or leaf icon
> >
> >
> > On Thu, Dec 18, 2008 at 9:07 PM, Dan Vega  wrote:
> >
> >>   but not every folder will be a branch, only those who have 
children. I
> >> can set the default leaf icon to a standar folder but I am stuck 
on how to
> >> treat branches using my example.
> >>
> >>
> >
> >
> > --
> > Fotis Chatzinikos, Ph.D.
> > Founder,
> > Phinnovation
> > fotis.chatzini...@...,
> >  
> >
>




[flexcoders] Re: Tree and Array

2007-04-06 Thread nhp_ny
Thanks. i made i little changes to your sample, because having a 
children arraycollection in class gets the tree control to always 
display a folder icon. so this is the changed code. Thanks for the 
kickstart.

--
Class Node.as 
--

package
{
import mx.collections.ArrayCollection;

[Bindable]
public class Node
{
public var id:int=0;
public var label:String = "";
public var children:ArrayCollection;

public function aArr(obj:Object = null):void
{
if (obj != null)
{
this.id = obj.id;
this.label = obj.label;
this.children = null; // to get a page icon in tree
}
}
}
}


Project Main File text.mxml



http://www.adobe.com/2006/mxml";>









---

Thats all. and thanks to all.



--- In flexcoders@yahoogroups.com, "Nate Pearson" <[EMAIL PROTECTED]> 
wrote:
>
> I would stick with what you know and used nested array 
collections.  I
> was about to implement this structure when I checked out flexcoders
> and saw your post.  This should help you out a bit:
> 
> 1)  make your array into a class.
> 
> package dto
> {
>   import mx.collections.ArrayCollection;
>   
>   [Bindable]
>   public class aArr
>   {
>   public var id:int=0;
>   public var description:String = "";
>   public var children:ArrayCollection = new 
ArrayCollection
>   
>   public function aArr(obj:Object = null)
>   {
>if (obj != null)
>   {
>   this.id = obj.id;
>   this.description = 
description.SD;
>   this.children = new 
ArrayCollection;
>   }
>   }
>   }
> }
> 
> 
> As you see you have to add an arraycollection to your class.  This 
is
> where your children will go.
> 
> 2)  Build your data from what ever your source is and put it in 
these
> nested array collections.  If i were to do these from a .net
> webservice i would have it send over the data in a multidimensional
> array.  You can add the children to the correct parents with slick 
for
> and if statements.  
> 
> anyways, here is the code I would use to make a few layers(make sure
> you put class above in a file named "aArr.as" in a folder named 
dto):
> 
> 
>  xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
> 
>   
> 
>labelField="description" >
> 
> 
> 3)  You can see that to add a child you do addItem().  You can also
> specify where in the list you want to put the child with addItemAt
().  
> 
> I hope this helps.  If you have problems getting ur array into this
> nested array collection structure or finding out parents just reply
> with a chunk of data and I'll show you how I would put it into this 
form.
> 
> -Nate
> 
> --- In flexcoders@yahoogroups.com, "Sal"  wrote:
> >
> > hi,
> >   i have an array of records received from an amfphp call and i 
need 
> > to fill a tree control with that data. 
> > 
> > the array has this format:
> > 
> > aArr[0].id
> > aArr[0].description
> > aArr[0].parent
> > aArr[0].order
> > 
> > aArr[1].id
> > aArr[1].description
> > aArr[1].parent
> > aArr[1].order
> > 
> > ... and so on
> > 
> > i didn't find any method of the control that adds node or that 
sets 
> > node parent. 
> > 
> > Any ideas?
> > 
> > Thanks.
> >
>




[flexcoders] Re: Tree and Array

2007-04-05 Thread Nate Pearson
I would stick with what you know and used nested array collections.  I
was about to implement this structure when I checked out flexcoders
and saw your post.  This should help you out a bit:

1)  make your array into a class.

package dto
{
import mx.collections.ArrayCollection;

[Bindable]
public class aArr
{
public var id:int=0;
public var description:String = "";
public var children:ArrayCollection = new ArrayCollection

public function aArr(obj:Object = null)
{
 if (obj != null)
{
this.id = obj.id;
this.description = description.SD;
this.children = new ArrayCollection;
}
}
}
}


As you see you have to add an arraycollection to your class.  This is
where your children will go.

2)  Build your data from what ever your source is and put it in these
nested array collections.  If i were to do these from a .net
webservice i would have it send over the data in a multidimensional
array.  You can add the children to the correct parents with slick for
and if statements.  

anyways, here is the code I would use to make a few layers(make sure
you put class above in a file named "aArr.as" in a folder named dto):


http://www.adobe.com/2006/mxml"; layout="absolute">






3)  You can see that to add a child you do addItem().  You can also
specify where in the list you want to put the child with addItemAt().  

I hope this helps.  If you have problems getting ur array into this
nested array collection structure or finding out parents just reply
with a chunk of data and I'll show you how I would put it into this form.

-Nate

--- In flexcoders@yahoogroups.com, "Sal" <[EMAIL PROTECTED]> wrote:
>
> hi,
>   i have an array of records received from an amfphp call and i need 
> to fill a tree control with that data. 
> 
> the array has this format:
> 
> aArr[0].id
> aArr[0].description
> aArr[0].parent
> aArr[0].order
> 
> aArr[1].id
> aArr[1].description
> aArr[1].parent
> aArr[1].order
> 
> ... and so on
> 
> i didn't find any method of the control that adds node or that sets 
> node parent. 
> 
> Any ideas?
> 
> Thanks.
>




RE: [flexcoders] Re: Tree and Array

2007-04-05 Thread Tracy Spratt
Also, here is an example of searching an e4x xml-based tree:

http://www.cflex.net/showfiledetails.cfm?ChannelID=1&Object=File&objectI
D=554

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nhp_ny
Sent: Thursday, April 05, 2007 7:36 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree and Array

 

haven't found any search or filter or find method.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Yes, use e4x search/filter expressions to locate the node you want.
> 
> Tracy
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of nhp_ny
> Sent: Thursday, April 05, 2007 5:17 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Tree and Array
> 
> 
> 
> great!! thanks!!! ah!.. 1 more thing... before adding a node, i 
need 
> to find it's parent node. is there a node search thingy?
> 
> Thanks.
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "Tracy Spratt"  wrote:
> >
> > Oh, and to start from scratch, do:
> > 
> > var _xml:XML = ;
> > 
> > 
> > 
> > then:
> > 
> > var xmlNode:XML = ;
> > 
> > [EMAIL PROTECTED] = "somevalue";
> > 
> > _xml.appendChild(xmlNode)
> > 
> > 
> > 
> > Shold give you:
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of Tracy Spratt
> > Sent: Wednesday, April 04, 2007 9:57 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%
40yahoogroups.com> 
> > Subject: RE: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > The main method you will be using is appendChild(). See the docs:
> > 
> > http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> 
> <http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> > 
> > <http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> 
> <http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> > > 
> > 
> > Tracy
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of nhp_ny
> > Sent: Wednesday, April 04, 2007 8:41 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > ok... i built tree structures in many other languages, so i know 
> how 
> > to do it. In other langauges i usually use methods to do it .. 
like:
> > 
> > Tree.AddItem(Key, Item, Parent)
> > 
> > or
> > 
> > set Node = GetNode(parent)
> > Node.AddChild(key, item)
> > 
> > so, what i need.. are these methods in flex. How can i add data 
to 
> a 
> > tree control? i know that i have to first prepare a dataprovider 
> and 
> > that i can't work directly with the tree control, and you told me 
> to 
> > use e4x.. so ok... but how? where are the additem() or getparent
() 
> or 
> > whatever? i saw the manuals for e4x, and found out that its need 
to 
> > manipulate xml files, but all the samples in the manual just show 
> how 
> > to delete , add or modify xml data from an existing xml structure.
> > thats not my case... i need to start with an empty xml.
> > 
> > hope i've been clear.
> > 
> > thanks
> > 
> > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com

RE: [flexcoders] Re: Tree and Array

2007-04-05 Thread Tracy Spratt
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.
htm?context=LiveDocs_Parts&file=1863.html

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nhp_ny
Sent: Thursday, April 05, 2007 7:36 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree and Array

 

haven't found any search or filter or find method.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Yes, use e4x search/filter expressions to locate the node you want.
> 
> Tracy
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of nhp_ny
> Sent: Thursday, April 05, 2007 5:17 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Tree and Array
> 
> 
> 
> great!! thanks!!! ah!.. 1 more thing... before adding a node, i 
need 
> to find it's parent node. is there a node search thingy?
> 
> Thanks.
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "Tracy Spratt"  wrote:
> >
> > Oh, and to start from scratch, do:
> > 
> > var _xml:XML = ;
> > 
> > 
> > 
> > then:
> > 
> > var xmlNode:XML = ;
> > 
> > [EMAIL PROTECTED] = "somevalue";
> > 
> > _xml.appendChild(xmlNode)
> > 
> > 
> > 
> > Shold give you:
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of Tracy Spratt
> > Sent: Wednesday, April 04, 2007 9:57 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%
40yahoogroups.com> 
> > Subject: RE: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > The main method you will be using is appendChild(). See the docs:
> > 
> > http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> 
> <http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> > 
> > <http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> 
> <http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> > > 
> > 
> > Tracy
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of nhp_ny
> > Sent: Wednesday, April 04, 2007 8:41 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > ok... i built tree structures in many other languages, so i know 
> how 
> > to do it. In other langauges i usually use methods to do it .. 
like:
> > 
> > Tree.AddItem(Key, Item, Parent)
> > 
> > or
> > 
> > set Node = GetNode(parent)
> > Node.AddChild(key, item)
> > 
> > so, what i need.. are these methods in flex. How can i add data 
to 
> a 
> > tree control? i know that i have to first prepare a dataprovider 
> and 
> > that i can't work directly with the tree control, and you told me 
> to 
> > use e4x.. so ok... but how? where are the additem() or getparent
() 
> or 
> > whatever? i saw the manuals for e4x, and found out that its need 
to 
> > manipulate xml files, but all the samples in the manual just show 
> how 
> > to delete , add or modify xml data from an existing xml structure.
> > thats not my case... i need to start with an empty xml.
> > 
> > hope i've been clear.
> > 
> > thanks
> > 
> > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailt

RE: [flexcoders] Re: Tree and Array

2007-04-05 Thread Tracy Spratt
Oops, the nodes should have

been:

var _xml:XML = ;

var xmlNode:XML = ;

 

You need to provide a property to use for the label, and then specify
that as the labelField.  Or, if you want to use the node name as a
label, use a labelFunction.

 

Tracy

 

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nhp_ny
Sent: Thursday, April 05, 2007 7:15 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree and Array

 

using this sample, i keep getting errors. so i included a closing 
root tag and a closing node tag. after this, seems to compile without 
errors, but the tree component displays the xml source beside the 
folder icon. do you know where i canfind a sample of:
1. create a new XML tree empty structure.
2. add nodes indicating the parent node

i only need these two steps to do it all.
Is it possible that there's nothing on the entire net?

thanks.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Oh, and to start from scratch, do:
> 
> var _xml:XML = ;
> 
> 
> 
> then:
> 
> var xmlNode:XML = ;
> 
> [EMAIL PROTECTED] = "somevalue";
> 
> _xml.appendChild(xmlNode)
> 
> 
> 
> Shold give you:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Tracy Spratt
> Sent: Wednesday, April 04, 2007 9:57 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: RE: [flexcoders] Re: Tree and Array
> 
> 
> 
> The main method you will be using is appendChild(). See the docs:
> 
> http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> 
> <http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> > 
> 
> Tracy
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of nhp_ny
> Sent: Wednesday, April 04, 2007 8:41 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Tree and Array
> 
> 
> 
> ok... i built tree structures in many other languages, so i know 
how 
> to do it. In other langauges i usually use methods to do it .. like:
> 
> Tree.AddItem(Key, Item, Parent)
> 
> or
> 
> set Node = GetNode(parent)
> Node.AddChild(key, item)
> 
> so, what i need.. are these methods in flex. How can i add data to 
a 
> tree control? i know that i have to first prepare a dataprovider 
and 
> that i can't work directly with the tree control, and you told me 
to 
> use e4x.. so ok... but how? where are the additem() or getparent() 
or 
> whatever? i saw the manuals for e4x, and found out that its need to 
> manipulate xml files, but all the samples in the manual just show 
how 
> to delete , add or modify xml data from an existing xml structure.
> thats not my case... i need to start with an empty xml.
> 
> hope i've been clear.
> 
> thanks
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "Tracy Spratt"  wrote:
> >
> > You must build either XML, or an ArrayCollection of 
> ArrayCollections.
> > 
> > 
> > 
> > Are you asking how to construct the logic to read your array and 
> build
> > the dataProvider?
> > 
> > 
> > 
> > It will depend on the exact character of the array data. For 
> example,
> > are you assured that a parent will be defined before any of its 
> children
> > are?
> > 
> > 
> > 
> > Tracy
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of nhp_ny
> > Sent: Wednesday, April 04, 2007 3:52 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > thanks, but i have already seen all these pages. they all talk 
> about 
> > xml lis

[flexcoders] Re: Tree and Array

2007-04-05 Thread nhp_ny
haven't found any search or filter or find method.


--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Yes, use e4x search/filter expressions to locate the node you want.
> 
> Tracy
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of nhp_ny
> Sent: Thursday, April 05, 2007 5:17 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Tree and Array
> 
>  
> 
> great!! thanks!!! ah!.. 1 more thing... before adding a node, i 
need 
> to find it's parent node. is there a node search thingy?
> 
> Thanks.
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> , "Tracy Spratt"  wrote:
> >
> > Oh, and to start from scratch, do:
> > 
> > var _xml:XML = ;
> > 
> > 
> > 
> > then:
> > 
> > var xmlNode:XML = ;
> > 
> > [EMAIL PROTECTED] = "somevalue";
> > 
> > _xml.appendChild(xmlNode)
> > 
> > 
> > 
> > Shold give you:
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of Tracy Spratt
> > Sent: Wednesday, April 04, 2007 9:57 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com> 
> > Subject: RE: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > The main method you will be using is appendChild(). See the docs:
> > 
> > http://livedocs.adobe.com/flex/201/langref/XML.html
> <http://livedocs.adobe.com/flex/201/langref/XML.html> 
> > <http://livedocs.adobe.com/flex/201/langref/XML.html
> <http://livedocs.adobe.com/flex/201/langref/XML.html> > 
> > 
> > Tracy
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of nhp_ny
> > Sent: Wednesday, April 04, 2007 8:41 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > ok... i built tree structures in many other languages, so i know 
> how 
> > to do it. In other langauges i usually use methods to do it .. 
like:
> > 
> > Tree.AddItem(Key, Item, Parent)
> > 
> > or
> > 
> > set Node = GetNode(parent)
> > Node.AddChild(key, item)
> > 
> > so, what i need.. are these methods in flex. How can i add data 
to 
> a 
> > tree control? i know that i have to first prepare a dataprovider 
> and 
> > that i can't work directly with the tree control, and you told me 
> to 
> > use e4x.. so ok... but how? where are the additem() or getparent
() 
> or 
> > whatever? i saw the manuals for e4x, and found out that its need 
to 
> > manipulate xml files, but all the samples in the manual just show 
> how 
> > to delete , add or modify xml data from an existing xml structure.
> > thats not my case... i need to start with an empty xml.
> > 
> > hope i've been clear.
> > 
> > thanks
> > 
> > --- In flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
> 40yahoogroups.com>
> > , "Tracy Spratt"  wrote:
> > >
> > > You must build either XML, or an ArrayCollection of 
> > ArrayCollections.
> > > 
> > > 
> > > 
> > > Are you asking how to construct the logic to read your array 
and 
> > build
> > > the dataProvider?
> > > 
> > > 
> > > 
> > > It will depend on the exact character of the array data. For 
> > example,
> > > are you assured that a parent will be defined before any of its 
> > children
> > > are?
> > > 
> > > 
> > > 
> > > Tracy
> > > 
> > > 
> > > 
> > > 
> > > 
> > > From: flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
> 40yahoogroups.com>
> > 
> > [mailto:flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
> 40yahoogroups.c

[flexcoders] Re: Tree and Array

2007-04-05 Thread nhp_ny
using this sample, i keep getting errors. so i included a closing 
root tag and a closing node tag. after this, seems to compile without 
errors, but the tree component displays the xml source beside the 
folder icon. do you know where i canfind a sample of:
1. create a new XML tree empty structure.
2. add nodes indicating the parent node

i only need these two steps to do it all.
Is it possible that there's nothing on the entire net?

thanks.

--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Oh, and to start from scratch, do:
> 
> var _xml:XML = ;
> 
>  
> 
> then:
> 
>  var xmlNode:XML = ;
> 
>  [EMAIL PROTECTED] = "somevalue";
> 
> _xml.appendChild(xmlNode)
> 
>  
> 
> Shold give you:
> 
> 
> 
>   
> 
> 
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of Tracy Spratt
> Sent: Wednesday, April 04, 2007 9:57 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Re: Tree and Array
> 
>  
> 
> The main method you will be using is appendChild().  See the docs:
> 
> http://livedocs.adobe.com/flex/201/langref/XML.html
> <http://livedocs.adobe.com/flex/201/langref/XML.html> 
> 
> Tracy
> 
>  
> 
> ____
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of nhp_ny
> Sent: Wednesday, April 04, 2007 8:41 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Tree and Array
> 
>  
> 
> ok... i built tree structures in many other languages, so i know 
how 
> to do it. In other langauges i usually use methods to do it .. like:
> 
> Tree.AddItem(Key, Item, Parent)
> 
> or
> 
> set Node = GetNode(parent)
> Node.AddChild(key, item)
> 
> so, what i need.. are these methods in flex. How can i add data to 
a 
> tree control? i know that i have to first prepare a dataprovider 
and 
> that i can't work directly with the tree control, and you told me 
to 
> use e4x.. so ok... but how? where are the additem() or getparent() 
or 
> whatever? i saw the manuals for e4x, and found out that its need to 
> manipulate xml files, but all the samples in the manual just show 
how 
> to delete , add or modify xml data from an existing xml structure.
> thats not my case... i need to start with an empty xml.
> 
> hope i've been clear.
> 
> thanks
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> , "Tracy Spratt"  wrote:
> >
> > You must build either XML, or an ArrayCollection of 
> ArrayCollections.
> > 
> > 
> > 
> > Are you asking how to construct the logic to read your array and 
> build
> > the dataProvider?
> > 
> > 
> > 
> > It will depend on the exact character of the array data. For 
> example,
> > are you assured that a parent will be defined before any of its 
> children
> > are?
> > 
> > 
> > 
> > Tracy
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of nhp_ny
> > Sent: Wednesday, April 04, 2007 3:52 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > thanks, but i have already seen all these pages. they all talk 
> about 
> > xml lists and collections. nothing about working with arrays. i 
> Know 
> > that a tree can also read from an array dataprovider.. so i need 
to 
> > know how to add nodes, branches, elemets , parents or whatever is 
> > needed to build a tree from an array of mysql records.
> > 
> > --- In flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
> 40yahoogroups.com>
> > , "mapper2255"  
> > wrote:
> > >
> > > 
> > > Here are a couple links:
> > > 
> > > http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
> <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> 
> > <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
> <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> > 
> > > 
> > > http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
> <http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> 
> > <http://www.flex2components.com

RE: [flexcoders] Re: Tree and Array

2007-04-05 Thread Tracy Spratt
Yes, use e4x search/filter expressions to locate the node you want.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nhp_ny
Sent: Thursday, April 05, 2007 5:17 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree and Array

 

great!! thanks!!! ah!.. 1 more thing... before adding a node, i need 
to find it's parent node. is there a node search thingy?

Thanks.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Oh, and to start from scratch, do:
> 
> var _xml:XML = ;
> 
> 
> 
> then:
> 
> var xmlNode:XML = ;
> 
> [EMAIL PROTECTED] = "somevalue";
> 
> _xml.appendChild(xmlNode)
> 
> 
> 
> Shold give you:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Tracy Spratt
> Sent: Wednesday, April 04, 2007 9:57 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: RE: [flexcoders] Re: Tree and Array
> 
> 
> 
> The main method you will be using is appendChild(). See the docs:
> 
> http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> 
> <http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> > 
> 
> Tracy
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of nhp_ny
> Sent: Wednesday, April 04, 2007 8:41 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Tree and Array
> 
> 
> 
> ok... i built tree structures in many other languages, so i know 
how 
> to do it. In other langauges i usually use methods to do it .. like:
> 
> Tree.AddItem(Key, Item, Parent)
> 
> or
> 
> set Node = GetNode(parent)
> Node.AddChild(key, item)
> 
> so, what i need.. are these methods in flex. How can i add data to 
a 
> tree control? i know that i have to first prepare a dataprovider 
and 
> that i can't work directly with the tree control, and you told me 
to 
> use e4x.. so ok... but how? where are the additem() or getparent() 
or 
> whatever? i saw the manuals for e4x, and found out that its need to 
> manipulate xml files, but all the samples in the manual just show 
how 
> to delete , add or modify xml data from an existing xml structure.
> thats not my case... i need to start with an empty xml.
> 
> hope i've been clear.
> 
> thanks
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "Tracy Spratt"  wrote:
> >
> > You must build either XML, or an ArrayCollection of 
> ArrayCollections.
> > 
> > 
> > 
> > Are you asking how to construct the logic to read your array and 
> build
> > the dataProvider?
> > 
> > 
> > 
> > It will depend on the exact character of the array data. For 
> example,
> > are you assured that a parent will be defined before any of its 
> children
> > are?
> > 
> > 
> > 
> > Tracy
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of nhp_ny
> > Sent: Wednesday, April 04, 2007 3:52 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
<mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > thanks, but i have already seen all these pages. they all talk 
> about 
> > xml lists and collections. nothing about working with arrays. i 
> Know 
> > that a tree can also read from an array dataprovider.. so i need 
to 
> > know how to add nodes, branches, elemets , parents or whatever is 
> > needed to build a tree from an array of mysql records.
> > 
> > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%
> 40yahoogroups.com>
> &

[flexcoders] Re: Tree and Array

2007-04-05 Thread nhp_ny
great!! thanks!!! ah!.. 1 more thing... before adding a node, i need 
to find it's parent node. is there a node search thingy?

Thanks.



--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Oh, and to start from scratch, do:
> 
> var _xml:XML = ;
> 
>  
> 
> then:
> 
>  var xmlNode:XML = ;
> 
>  [EMAIL PROTECTED] = "somevalue";
> 
> _xml.appendChild(xmlNode)
> 
>  
> 
> Shold give you:
> 
> 
> 
>   
> 
> 
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of Tracy Spratt
> Sent: Wednesday, April 04, 2007 9:57 PM
> To: flexcoders@yahoogroups.com
> Subject: RE: [flexcoders] Re: Tree and Array
> 
>  
> 
> The main method you will be using is appendChild().  See the docs:
> 
> http://livedocs.adobe.com/flex/201/langref/XML.html
> <http://livedocs.adobe.com/flex/201/langref/XML.html> 
> 
> Tracy
> 
>  
> 
> ____
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of nhp_ny
> Sent: Wednesday, April 04, 2007 8:41 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Tree and Array
> 
>  
> 
> ok... i built tree structures in many other languages, so i know 
how 
> to do it. In other langauges i usually use methods to do it .. like:
> 
> Tree.AddItem(Key, Item, Parent)
> 
> or
> 
> set Node = GetNode(parent)
> Node.AddChild(key, item)
> 
> so, what i need.. are these methods in flex. How can i add data to 
a 
> tree control? i know that i have to first prepare a dataprovider 
and 
> that i can't work directly with the tree control, and you told me 
to 
> use e4x.. so ok... but how? where are the additem() or getparent() 
or 
> whatever? i saw the manuals for e4x, and found out that its need to 
> manipulate xml files, but all the samples in the manual just show 
how 
> to delete , add or modify xml data from an existing xml structure.
> thats not my case... i need to start with an empty xml.
> 
> hope i've been clear.
> 
> thanks
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> , "Tracy Spratt"  wrote:
> >
> > You must build either XML, or an ArrayCollection of 
> ArrayCollections.
> > 
> > 
> > 
> > Are you asking how to construct the logic to read your array and 
> build
> > the dataProvider?
> > 
> > 
> > 
> > It will depend on the exact character of the array data. For 
> example,
> > are you assured that a parent will be defined before any of its 
> children
> > are?
> > 
> > 
> > 
> > Tracy
> > 
> > 
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of nhp_ny
> > Sent: Wednesday, April 04, 2007 3:52 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Re: Tree and Array
> > 
> > 
> > 
> > thanks, but i have already seen all these pages. they all talk 
> about 
> > xml lists and collections. nothing about working with arrays. i 
> Know 
> > that a tree can also read from an array dataprovider.. so i need 
to 
> > know how to add nodes, branches, elemets , parents or whatever is 
> > needed to build a tree from an array of mysql records.
> > 
> > --- In flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
> 40yahoogroups.com>
> > , "mapper2255"  
> > wrote:
> > >
> > > 
> > > Here are a couple links:
> > > 
> > > http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
> <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> 
> > <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
> <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> > 
> > > 
> > > http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
> <http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> 
> > <http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
> <http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> > 
> > > walking-the-tree-method/
> > > 
> > > I know it was for the Cairgorm Store but I did a keyword on 
these 
> > > archives of: "e

RE: [flexcoders] Re: Tree and Array

2007-04-04 Thread Tracy Spratt
Oh, and to start from scratch, do:

var _xml:XML = ;

 

then:

 var xmlNode:XML = ;

 [EMAIL PROTECTED] = "somevalue";

_xml.appendChild(xmlNode)

 

Shold give you:



  



 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Wednesday, April 04, 2007 9:57 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Tree and Array

 

The main method you will be using is appendChild().  See the docs:

http://livedocs.adobe.com/flex/201/langref/XML.html
<http://livedocs.adobe.com/flex/201/langref/XML.html> 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nhp_ny
Sent: Wednesday, April 04, 2007 8:41 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree and Array

 

ok... i built tree structures in many other languages, so i know how 
to do it. In other langauges i usually use methods to do it .. like:

Tree.AddItem(Key, Item, Parent)

or

set Node = GetNode(parent)
Node.AddChild(key, item)

so, what i need.. are these methods in flex. How can i add data to a 
tree control? i know that i have to first prepare a dataprovider and 
that i can't work directly with the tree control, and you told me to 
use e4x.. so ok... but how? where are the additem() or getparent() or 
whatever? i saw the manuals for e4x, and found out that its need to 
manipulate xml files, but all the samples in the manual just show how 
to delete , add or modify xml data from an existing xml structure.
thats not my case... i need to start with an empty xml.

hope i've been clear.

thanks

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> You must build either XML, or an ArrayCollection of 
ArrayCollections.
> 
> 
> 
> Are you asking how to construct the logic to read your array and 
build
> the dataProvider?
> 
> 
> 
> It will depend on the exact character of the array data. For 
example,
> are you assured that a parent will be defined before any of its 
children
> are?
> 
> 
> 
> Tracy
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of nhp_ny
> Sent: Wednesday, April 04, 2007 3:52 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Tree and Array
> 
> 
> 
> thanks, but i have already seen all these pages. they all talk 
about 
> xml lists and collections. nothing about working with arrays. i 
Know 
> that a tree can also read from an array dataprovider.. so i need to 
> know how to add nodes, branches, elemets , parents or whatever is 
> needed to build a tree from an array of mysql records.
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "mapper2255"  
> wrote:
> >
> > 
> > Here are a couple links:
> > 
> > http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
<http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> 
> <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
<http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> > 
> > 
> > http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
<http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> 
> <http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
<http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> > 
> > walking-the-tree-method/
> > 
> > I know it was for the Cairgorm Store but I did a keyword on these 
> > archives of: "events tree cairgorm" and got 52 results a lot with 
> > the tree component.
> > 
> > Hope it helps some.
> > 
> > 
> > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> , "Sal"  wrote:
> > >
> > > how? can't find a sample... can't find docs on it... does that 
> > mean 
> > > i'll need to build a tree structure inside an array and then 
pass 
> > it 
> > > to the data provider? if so... are there docs or samples on 
this? 
> > how 
> > > to add an array child of an array element?
> > > 
> > > Thanks
> > > 
> > > 
> > > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> , "Alex Harui"  
wrote:
> > > >
> > > > You

RE: [flexcoders] Re: Tree and Array

2007-04-04 Thread Tracy Spratt
The main method you will be using is appendChild().  See the docs:

http://livedocs.adobe.com/flex/201/langref/XML.html

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nhp_ny
Sent: Wednesday, April 04, 2007 8:41 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree and Array

 

ok... i built tree structures in many other languages, so i know how 
to do it. In other langauges i usually use methods to do it .. like:

Tree.AddItem(Key, Item, Parent)

or

set Node = GetNode(parent)
Node.AddChild(key, item)

so, what i need.. are these methods in flex. How can i add data to a 
tree control? i know that i have to first prepare a dataprovider and 
that i can't work directly with the tree control, and you told me to 
use e4x.. so ok... but how? where are the additem() or getparent() or 
whatever? i saw the manuals for e4x, and found out that its need to 
manipulate xml files, but all the samples in the manual just show how 
to delete , add or modify xml data from an existing xml structure.
thats not my case... i need to start with an empty xml.

hope i've been clear.

thanks

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> You must build either XML, or an ArrayCollection of 
ArrayCollections.
> 
> 
> 
> Are you asking how to construct the logic to read your array and 
build
> the dataProvider?
> 
> 
> 
> It will depend on the exact character of the array data. For 
example,
> are you assured that a parent will be defined before any of its 
children
> are?
> 
> 
> 
> Tracy
> 
> 
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of nhp_ny
> Sent: Wednesday, April 04, 2007 3:52 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Tree and Array
> 
> 
> 
> thanks, but i have already seen all these pages. they all talk 
about 
> xml lists and collections. nothing about working with arrays. i 
Know 
> that a tree can also read from an array dataprovider.. so i need to 
> know how to add nodes, branches, elemets , parents or whatever is 
> needed to build a tree from an array of mysql records.
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "mapper2255"  
> wrote:
> >
> > 
> > Here are a couple links:
> > 
> > http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
<http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> 
> <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
<http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> > 
> > 
> > http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
<http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> 
> <http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
<http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> > 
> > walking-the-tree-method/
> > 
> > I know it was for the Cairgorm Store but I did a keyword on these 
> > archives of: "events tree cairgorm" and got 52 results a lot with 
> > the tree component.
> > 
> > Hope it helps some.
> > 
> > 
> > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> , "Sal"  wrote:
> > >
> > > how? can't find a sample... can't find docs on it... does that 
> > mean 
> > > i'll need to build a tree structure inside an array and then 
pass 
> > it 
> > > to the data provider? if so... are there docs or samples on 
this? 
> > how 
> > > to add an array child of an array element?
> > > 
> > > Thanks
> > > 
> > > 
> > > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> , "Alex Harui"  
wrote:
> > > >
> > > > You have to build up the dataprovider and pass it into the 
> > tree. 
> > > If you
> > > > change the dataprovider later, the tree will notice in most 
> > cases.
> > > > 
> > > > 
> > > > 
> > > > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> 
> > > [mailto:flexcoders@yahoogroups.com
<mai

[flexcoders] Re: Tree and Array

2007-04-04 Thread nhp_ny
ok... i built tree structures in many other languages, so i know how 
to do it. In other langauges i usually use methods to do it .. like:

Tree.AddItem(Key, Item, Parent)

or

set Node = GetNode(parent)
Node.AddChild(key, item)

so, what i need.. are these methods in flex. How can i add data to a 
tree control? i know that i have to first prepare a dataprovider and 
that i can't work directly with the tree control, and you told me to 
use e4x.. so ok... but how? where are the additem() or getparent() or 
whatever? i saw the manuals for e4x, and found out that its need to 
manipulate xml files, but all the samples in the manual just show how 
to delete , add or modify xml data from an existing xml structure.
thats not my case... i need to start with an empty xml.

hope i've been clear.

thanks



--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> You must build either XML, or an ArrayCollection of 
ArrayCollections.
> 
>  
> 
> Are you asking how to construct the logic to read your array and 
build
> the dataProvider?
> 
>  
> 
> It will depend on the exact character of the array data.  For 
example,
> are you assured that a parent will be defined before any of its 
children
> are?
> 
>  
> 
> Tracy
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of nhp_ny
> Sent: Wednesday, April 04, 2007 3:52 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Tree and Array
> 
>  
> 
> thanks, but i have already seen all these pages. they all talk 
about 
> xml lists and collections. nothing about working with arrays. i 
Know 
> that a tree can also read from an array dataprovider.. so i need to 
> know how to add nodes, branches, elemets , parents or whatever is 
> needed to build a tree from an array of mysql records.
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> , "mapper2255"  
> wrote:
> >
> > 
> > Here are a couple links:
> > 
> > http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
> <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> 
> > 
> > http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
> <http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> 
> > walking-the-tree-method/
> > 
> > I know it was for the Cairgorm Store but I did a keyword on these 
> > archives of: "events tree cairgorm" and got 52 results a lot with 
> > the tree component.
> > 
> > Hope it helps some.
> > 
> > 
> > --- In flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com> , "Sal"  wrote:
> > >
> > > how? can't find a sample... can't find docs on it... does that 
> > mean 
> > > i'll need to build a tree structure inside an array and then 
pass 
> > it 
> > > to the data provider? if so... are there docs or samples on 
this? 
> > how 
> > > to add an array child of an array element?
> > > 
> > > Thanks
> > > 
> > > 
> > > --- In flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com> , "Alex Harui"  
wrote:
> > > >
> > > > You have to build up the dataprovider and pass it into the 
> > tree. 
> > > If you
> > > > change the dataprovider later, the tree will notice in most 
> > cases.
> > > > 
> > > > 
> > > > 
> > > > From: flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  
> > > [mailto:flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com> ] On
> > > > Behalf Of Sal
> > > > Sent: Tuesday, April 03, 2007 5:38 PM
> > > > To: flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com> 
> > > > Subject: [flexcoders] Tree and Array
> > > > 
> > > > 
> > > > 
> > > > hi,
> > > > i have an array of records received from an amfphp call and i 
> > need 
> > > > to fill a tree control with that data. 
> > > > 
> > > > the array has this format:
> > > > 
> > > > aArr[0].id
> > > > aArr[0].description
> > > > aArr[0].parent
> > > > aArr[0].order
> > > > 
> > > > aArr[1].id
> > > > aArr[1].description
> > > > aArr[1].parent
> > > > aArr[1].order
> > > > 
> > > > ... and so on
> > > > 
> > > > i didn't find any method of the control that adds node or 
that 
> > sets 
> > > > node parent. 
> > > > 
> > > > Any ideas?
> > > > 
> > > > Thanks.
> > > >
> > >
> >
>




RE: [flexcoders] Re: Tree and Array

2007-04-04 Thread Tracy Spratt
You must build either XML, or an ArrayCollection of ArrayCollections.

 

Are you asking how to construct the logic to read your array and build
the dataProvider?

 

It will depend on the exact character of the array data.  For example,
are you assured that a parent will be defined before any of its children
are?

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nhp_ny
Sent: Wednesday, April 04, 2007 3:52 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree and Array

 

thanks, but i have already seen all these pages. they all talk about 
xml lists and collections. nothing about working with arrays. i Know 
that a tree can also read from an array dataprovider.. so i need to 
know how to add nodes, branches, elemets , parents or whatever is 
needed to build a tree from an array of mysql records.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "mapper2255" <[EMAIL PROTECTED]> 
wrote:
>
> 
> Here are a couple links:
> 
> http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
<http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> 
> 
> http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
<http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> 
> walking-the-tree-method/
> 
> I know it was for the Cairgorm Store but I did a keyword on these 
> archives of: "events tree cairgorm" and got 52 results a lot with 
> the tree component.
> 
> Hope it helps some.
> 
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> , "Sal"  wrote:
> >
> > how? can't find a sample... can't find docs on it... does that 
> mean 
> > i'll need to build a tree structure inside an array and then pass 
> it 
> > to the data provider? if so... are there docs or samples on this? 
> how 
> > to add an array child of an array element?
> > 
> > Thanks
> > 
> > 
> > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> , "Alex Harui"  wrote:
> > >
> > > You have to build up the dataprovider and pass it into the 
> tree. 
> > If you
> > > change the dataprovider later, the tree will notice in most 
> cases.
> > > 
> > > 
> > > 
> > > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  
> > [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> ] On
> > > Behalf Of Sal
> > > Sent: Tuesday, April 03, 2007 5:38 PM
> > > To: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> > > Subject: [flexcoders] Tree and Array
> > > 
> > > 
> > > 
> > > hi,
> > > i have an array of records received from an amfphp call and i 
> need 
> > > to fill a tree control with that data. 
> > > 
> > > the array has this format:
> > > 
> > > aArr[0].id
> > > aArr[0].description
> > > aArr[0].parent
> > > aArr[0].order
> > > 
> > > aArr[1].id
> > > aArr[1].description
> > > aArr[1].parent
> > > aArr[1].order
> > > 
> > > ... and so on
> > > 
> > > i didn't find any method of the control that adds node or that 
> sets 
> > > node parent. 
> > > 
> > > Any ideas?
> > > 
> > > Thanks.
> > >
> >
>

 



[flexcoders] Re: Tree and Array

2007-04-04 Thread nhp_ny
is there a sample somewhere? can i start from and empty XML? can i 
add elements and child elements simply putting a parent id ? thanks


--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> I would loop over the array and build XML.  The Tree likes XML.
> 
>  
> 
> Either use the e4x methods to build the XML, or just build a string 
and
> parse it into XML using varxml:XML = XML(strXML);
> 
>  
> 
> Tracy
> 
>  
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of mapper2255
> Sent: Wednesday, April 04, 2007 9:18 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Tree and Array
> 
>  
> 
> 
> Here are a couple links:
> 
> http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
> <http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> 
> 
> http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
> <http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> 
> walking-the-tree-method/
> 
> I know it was for the Cairgorm Store but I did a keyword on these 
> archives of: "events tree cairgorm" and got 52 results a lot with 
> the tree component.
> 
> Hope it helps some.
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> , "Sal"  wrote:
> >
> > how? can't find a sample... can't find docs on it... does that 
> mean 
> > i'll need to build a tree structure inside an array and then pass 
> it 
> > to the data provider? if so... are there docs or samples on this? 
> how 
> > to add an array child of an array element?
> > 
> > Thanks
> > 
> > 
> > --- In flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com> , "Alex Harui"  
wrote:
> > >
> > > You have to build up the dataprovider and pass it into the 
> tree. 
> > If you
> > > change the dataprovider later, the tree will notice in most 
> cases.
> > > 
> > > 
> > > 
> > > From: flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com>  
> > [mailto:flexcoders@yahoogroups.com
> <mailto:flexcoders%40yahoogroups.com> ] On
> > > Behalf Of Sal
> > > Sent: Tuesday, April 03, 2007 5:38 PM
> > > To: flexcoders@yahoogroups.com <mailto:flexcoders%
40yahoogroups.com>
> 
> > > Subject: [flexcoders] Tree and Array
> > > 
> > > 
> > > 
> > > hi,
> > > i have an array of records received from an amfphp call and i 
> need 
> > > to fill a tree control with that data. 
> > > 
> > > the array has this format:
> > > 
> > > aArr[0].id
> > > aArr[0].description
> > > aArr[0].parent
> > > aArr[0].order
> > > 
> > > aArr[1].id
> > > aArr[1].description
> > > aArr[1].parent
> > > aArr[1].order
> > > 
> > > ... and so on
> > > 
> > > i didn't find any method of the control that adds node or that 
> sets 
> > > node parent. 
> > > 
> > > Any ideas?
> > > 
> > > Thanks.
> > >
> >
>




[flexcoders] Re: Tree and Array

2007-04-04 Thread nhp_ny
thanks, but i have already seen all these pages. they all talk about 
xml lists and collections. nothing about working with arrays. i Know 
that a tree can also read from an array dataprovider.. so i need to 
know how to add nodes, branches, elemets , parents or whatever is 
needed to build a tree from an array of mysql records.


--- In flexcoders@yahoogroups.com, "mapper2255" <[EMAIL PROTECTED]> 
wrote:
>
> 
> Here are a couple links:
> 
> http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
> 
> http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
> walking-the-tree-method/
> 
> I know it was for the Cairgorm Store but I did a keyword on these 
> archives of: "events tree cairgorm" and got 52 results a lot with 
> the tree component.
> 
> Hope it helps some.
> 
> 
> --- In flexcoders@yahoogroups.com, "Sal"  wrote:
> >
> > how? can't find a sample... can't find docs on it... does that 
> mean 
> > i'll need to build a tree structure inside an array and then pass 
> it 
> > to the data provider? if so... are there docs or samples on this? 
> how 
> > to add an array child of an array element?
> > 
> > Thanks
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "Alex Harui"  wrote:
> > >
> > > You have to build up the dataprovider and pass it into the 
> tree.  
> > If you
> > > change the dataprovider later, the tree will notice in most 
> cases.
> > > 
> > > 
> > > 
> > > From: flexcoders@yahoogroups.com 
> > [mailto:[EMAIL PROTECTED] On
> > > Behalf Of Sal
> > > Sent: Tuesday, April 03, 2007 5:38 PM
> > > To: flexcoders@yahoogroups.com
> > > Subject: [flexcoders] Tree and Array
> > > 
> > > 
> > > 
> > > hi,
> > > i have an array of records received from an amfphp call and i 
> need 
> > > to fill a tree control with that data. 
> > > 
> > > the array has this format:
> > > 
> > > aArr[0].id
> > > aArr[0].description
> > > aArr[0].parent
> > > aArr[0].order
> > > 
> > > aArr[1].id
> > > aArr[1].description
> > > aArr[1].parent
> > > aArr[1].order
> > > 
> > > ... and so on
> > > 
> > > i didn't find any method of the control that adds node or that 
> sets 
> > > node parent. 
> > > 
> > > Any ideas?
> > > 
> > > Thanks.
> > >
> >
>




RE: [flexcoders] Re: Tree and Array

2007-04-04 Thread Tracy Spratt
I would loop over the array and build XML.  The Tree likes XML.

 

Either use the e4x methods to build the XML, or just build a string and
parse it into XML using varxml:XML = XML(strXML);

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of mapper2255
Sent: Wednesday, April 04, 2007 9:18 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree and Array

 


Here are a couple links:

http://www.adobe.com/devnet/flex/quickstart/working_with_tree/
<http://www.adobe.com/devnet/flex/quickstart/working_with_tree/> 

http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
<http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-> 
walking-the-tree-method/

I know it was for the Cairgorm Store but I did a keyword on these 
archives of: "events tree cairgorm" and got 52 results a lot with 
the tree component.

Hope it helps some.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Sal" <[EMAIL PROTECTED]> wrote:
>
> how? can't find a sample... can't find docs on it... does that 
mean 
> i'll need to build a tree structure inside an array and then pass 
it 
> to the data provider? if so... are there docs or samples on this? 
how 
> to add an array child of an array element?
> 
> Thanks
> 
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> , "Alex Harui"  wrote:
> >
> > You have to build up the dataprovider and pass it into the 
tree. 
> If you
> > change the dataprovider later, the tree will notice in most 
cases.
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  
> [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> ] On
> > Behalf Of Sal
> > Sent: Tuesday, April 03, 2007 5:38 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

> > Subject: [flexcoders] Tree and Array
> > 
> > 
> > 
> > hi,
> > i have an array of records received from an amfphp call and i 
need 
> > to fill a tree control with that data. 
> > 
> > the array has this format:
> > 
> > aArr[0].id
> > aArr[0].description
> > aArr[0].parent
> > aArr[0].order
> > 
> > aArr[1].id
> > aArr[1].description
> > aArr[1].parent
> > aArr[1].order
> > 
> > ... and so on
> > 
> > i didn't find any method of the control that adds node or that 
sets 
> > node parent. 
> > 
> > Any ideas?
> > 
> > Thanks.
> >
>

 



[flexcoders] Re: Tree and Array

2007-04-04 Thread mapper2255

Here are a couple links:

http://www.adobe.com/devnet/flex/quickstart/working_with_tree/

http://www.flex2components.com/f2cblog/2006/10/16/flex-2-tree-
walking-the-tree-method/

I know it was for the Cairgorm Store but I did a keyword on these 
archives of: "events tree cairgorm" and got 52 results a lot with 
the tree component.

Hope it helps some.


--- In flexcoders@yahoogroups.com, "Sal" <[EMAIL PROTECTED]> wrote:
>
> how? can't find a sample... can't find docs on it... does that 
mean 
> i'll need to build a tree structure inside an array and then pass 
it 
> to the data provider? if so... are there docs or samples on this? 
how 
> to add an array child of an array element?
> 
> Thanks
> 
> 
> --- In flexcoders@yahoogroups.com, "Alex Harui"  wrote:
> >
> > You have to build up the dataprovider and pass it into the 
tree.  
> If you
> > change the dataprovider later, the tree will notice in most 
cases.
> > 
> > 
> > 
> > From: flexcoders@yahoogroups.com 
> [mailto:[EMAIL PROTECTED] On
> > Behalf Of Sal
> > Sent: Tuesday, April 03, 2007 5:38 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Tree and Array
> > 
> > 
> > 
> > hi,
> > i have an array of records received from an amfphp call and i 
need 
> > to fill a tree control with that data. 
> > 
> > the array has this format:
> > 
> > aArr[0].id
> > aArr[0].description
> > aArr[0].parent
> > aArr[0].order
> > 
> > aArr[1].id
> > aArr[1].description
> > aArr[1].parent
> > aArr[1].order
> > 
> > ... and so on
> > 
> > i didn't find any method of the control that adds node or that 
sets 
> > node parent. 
> > 
> > Any ideas?
> > 
> > Thanks.
> >
>




[flexcoders] Re: Tree and Array

2007-04-04 Thread Sal
how? can't find a sample... can't find docs on it... does that mean 
i'll need to build a tree structure inside an array and then pass it 
to the data provider? if so... are there docs or samples on this? how 
to add an array child of an array element?

Thanks


--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> You have to build up the dataprovider and pass it into the tree.  
If you
> change the dataprovider later, the tree will notice in most cases.
> 
> 
> 
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of Sal
> Sent: Tuesday, April 03, 2007 5:38 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Tree and Array
> 
> 
> 
> hi,
> i have an array of records received from an amfphp call and i need 
> to fill a tree control with that data. 
> 
> the array has this format:
> 
> aArr[0].id
> aArr[0].description
> aArr[0].parent
> aArr[0].order
> 
> aArr[1].id
> aArr[1].description
> aArr[1].parent
> aArr[1].order
> 
> ... and so on
> 
> i didn't find any method of the control that adds node or that sets 
> node parent. 
> 
> Any ideas?
> 
> Thanks.
>