That's exactly what I'm talking about! Full code example can be found here.
 
http://lordbron.wordpress.com/2006/07/28/flex-20-reopening-a-tree-after-updating-the-dataprovider/
 
Pretty much, it involves the openItems property, the render event and a boolean value.
 
It may need some refining, as the example is merely a single branch tree, but at least it's doable and rather simple! 
 
Enjoy!
 


 
On 7/28/06, Tracy Spratt <[EMAIL PROTECTED]> wrote:

Huh, come on Tom, this is a pretty often desired behavior, please post your solution!  Do you mean that storing openItems and then re-assigning them in the "render" event restores the whole tree to its open state? 

 

That's damn big. I never did get something like this working in 1.5.

 

Tracy

 


From: [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] On Behalf Of Tom Ortega
Sent: Friday, July 28, 2006 7:54 PM
To: flexcoders
Subject: [flexcoders] Re: trees, UpdateDisplayList and keeping a tree open

 

Nevermind, I figured it out!  The secret is the "render" event. =)

On 7/28/06, Tom Ortega < [EMAIL PROTECTED] > wrote:

Hi all,

So, I'm trying to figure out how to refesh a tree's DataProvider and keep it open.

I thought trapping the trees.opentItems was my answer.  I'd trap the value before the refresh, then set it back to that value after the refesh:

                    tempOpen = mainTree.openItems;
                    mainTreeDP = event.result;
                    mainTree.validateNow();
                    mainTree.openItems = tempOpen;

But that didn't work.

I think the reason why is because the code gets executed before the tree display updates itself.

My dilemna now seems twofold:

1. I take it there's not a built in way to regress a tree back to it's open states?
2. How can I know when the update to the display is done, so I can manually traverse the tree and reopen everything?

The functionality is there because if you expand every node, the collapse the root, then open the root, everything is still expanded.  If I can just figure out how to mimic that in my ActionScript, I'd be set.

Any ideas?

Thanks,

Tom

 


__._,_.___

--
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