Yes, you can make an object hierarchy and then simply have the descriptor that you write return the appropriate child element.  The default descriptor simply returns the children property, your descriptor could return a different property based on what the type of the object is.  If you’re willing to make an object hierarchy doing this is very easy.  It’s when you don’t want to build the hierarchy yourself that you might need to do more work.  For example you say you have 3 RecordSources which is I guess a Microsoft thing?  The first RecordSource is of categories?  The second one is subcategories (is it all of the subcategories or is it just the subcategories for a particular category)?  And the third is the products (for all subcategories or only for one)?  If you have a descriptor you can make sure it has a reference to all three RecordSources and only returns the correct subsets or whatever when given a node.  For example, given a category, return the elements in the subcategory RecordSource that match up (or the whole RecordSource if it was one source per category), then do the equiv for products.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of Jignesh Dodiya
Sent: Friday, March 10, 2006 12:58 AM
To: [email protected]
Subject: Re: [flexcoders] Tree+ datas from mySQL

 

Matt,

 

Thanks for your descriptive reply.

 

Actually I am fetching RecordSource from database for categories and products. (categories have sub categories too). What I need to do is show all these products as tree. where all firstchild will be categories, they also have many childs as many sub categories they may have and finally they will have leaf as all products of that particular sub category.

 

I can get 3 recordset for categories, subcategories for particular category and finally items in that sub category. Now I dont want to process XML nodes as it may take more time as I have lots of data. Can't I make some object of tree herarchy and directly attach it to tree as dataProvider like we do in list, combo box etc?

 

I hope that my this description will able to visualize my problem to you.

 

Thanks again for your kind help.

 

Regards,

 

Jignesh

 

On 3/10/06, Matt Chotin <[EMAIL PROTECTED]> wrote:

Sorry Jignesh, a simple TreeDataDescriptor example will be coming in the B2 docs but I don't know if it will help.  How will your 2 or 3 ArrayCollections work.  What is the relationship between them?  Should you be considering building a structure of value objects on your server as opposed to assembling on the client?

 

If you do keep the 3 collections the main thing you need to do is define your getChildren function for the descriptor.  Given a node, find the children and return an ICollectionView with that data.  So how is that going to work, will you start out reading from one collection, then the children will be in the 2 nd collection, then the grandchildren will be in the 3rd?  If so, define your function to read that stuff appropriately.

 

If you provide some examples of what the data tables will look like and what the tree needs to look like maybe someone can help you further.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of Jignesh Dodiya
Sent: Thursday, March 09, 2006 10:14 PM


To: [email protected]
Subject: Re: [flexcoders] Tree+ datas from mySQL

 

Still i am not getting the sollution........

 

there is no any example for TreeDataDescriptor in the docs...........anybody has an idea how can I put data in tree control as from the mySQL database and from 2 different tables 

 

On 2/27/06, Jignesh Dodiya < [EMAIL PROTECTED]> wrote:

Its great,  thanx Matt,

 

Is there any working sample available regarding ths...............

 

Jignesh

 

On 2/27/06, Matt Chotin < [EMAIL PROTECTED]> wrote:

Flex 2 allows you to specify a TreeDataDescriptor for this exact purpose, specify the top-level data to the Tree and then use the descriptor to read into those other arrays as necessary for the children (or other parts of the data).

 

MAtt

 


From: [email protected] [mailto:[email protected]] On Behalf Of Jignesh Dodiya
Sent: Sunday, February 26, 2006 3:33 PM
To: [email protected]
Subject: Re: [flexcoders] Tree+ datas from mySQL

 

I think , it seems really very difficult or just it may be wrong way or  bad stuffs

 

 

On 2/26/06, Jignesh M. Dodiya < [EMAIL PROTECTED]> wrote:

hi,

Is there any idea how to provide data provider to tree component in
mySQL based datas...how can i use 2-3 COllection Array in to single
tree COntrol;

regards,
jignesh





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com

SPONSORED LINKS

Web site design development

Computer software development

Software design and development

Macromedia flex

Software development best practice

 

 


YAHOO! GROUPS LINKS

 

 





--
jignesh dodiya


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com


SPONSORED LINKS

Web site design development

Computer software development

Software design and development

Macromedia flex

Software development best practice

 

 


YAHOO! GROUPS LINKS

 

 




--
 

jignesh dodiya




--
jignesh dodiya


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



SPONSORED LINKS

Web site design development

Computer software development

Software design and development

Macromedia flex

Software development best practice

 

 


YAHOO! GROUPS LINKS

 

 





--
jignesh dodiya


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to