Hi Sean,

I have implemented TreeDataProvider interface and I must say that it was an
unpleasant task to do. I was left with a feeling that TreeDataProvider is
meant to be used only in theory, not in practice.

First of all, if you want to mix TreeNodes and your custom TreeDataProviders
in a tree, your customer TreeDataProvider must extend TreeNode. The
implementation of Tree (or was it TreeNode) expects that the nodes of the
Tree are instances of TreeNode (as it should expect instances of
TreeDataProvider).

I also had problems updating tree dynamically. I was able to update my data
provider but the changes were not reflected to user interface unless I
called Tree.modelChanged( { eventName:"updateTree" } ). I think the correct
way to handle this would be fire events from my data provider, but the API
documentation doesn't mention what kind of events I should fire and when.

The actual implementation of TreeDataProvider is quite straightforward.
Methods are mostly getters and setters and implementing them won't take
long. 

Good luck!

Markus


> -----Original Message-----
> From: [email protected] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Sean McKibben
> Sent: 13. kes�kuuta 2005 18:45
> To: [email protected]
> Subject: [flexcoders] TreeDataProvider implementation
> 
> 
> I believe that I need to write my own class which implements  
> TreeDataProvider, but am finding the task a bit daunting.
> Has anyone written their own TreeDataProvider that would be willing  
> to share it with me or the list?
> Is anyone aware of any articles about implementing TreeDataProvider?
> 
> I don't find much comfort in the liveDocs explanation at:
> http://livedocs.macromedia.com/flex/15/asdocs_en/mx/controls/ 
> treeclasses/TreeDataProvider.html
> and Developing Flex Applications and "the book" don't really give  
> many pointers either.
> 
> If there was some sort of reference implementation I could peek at,  
> I'd feel much better about heading down this path. It probably isn't  
> all that difficult, but it is a big chunk of time to waste if 
> I can't  
> make it work...
> 
> Thanks,
> Sean McKibben
> graphex at graphex com
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to