Does anyone have a working example of a simple collapse/expand tree list they can share? What I want to replicate is the standard open/ close node behavior, but I''m not sure how to make the parent node open and close correctly. Something like this: <ul> <li>Click me to open and close the sub list <ul> <li>One</li> <li>Two</li> </ul> </li> <li>more expandable parents...</li> <li>more expandable parents...</li> </ul>
I just saw something about that the other day off delicious, but damned if I bookmarked it. I don''t think I thought it was relevant for some reason...I dimly remember it being some sort of framework providing ajax integration mainly with php and asp if that''s any help ... The only other tree I know if isn''t completely client-side based, but is very good :) tacos.sourceforge.net <http://tacos.sourceforge.net> . j On 8/30/05, Andrew Otwell <andrew@heyotwell.com> wrote:> > Does anyone have a working example of a simple collapse/expand tree > list they can share? What I want to replicate is the standard open/ > close node behavior, but I''m not sure how to make the parent node > open and close correctly. Something like this: > > <ul> > <li>Click me to open and close the sub list > <ul> > <li>One</li> > <li>Two</li> > </ul> > </li> > <li>more expandable parents...</li> > <li>more expandable parents...</li> > </ul> > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050901/77ade2e1/attachment.html
Skipped content of type multipart/alternative-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050901/5e112190/tree.html
I''m not sure about Prototype/Scriptaculous, but here''s a pretty nice script that should do what you want: http://www.mattkruse.com/javascript/mktree/ Regards, Bill
Ed, it''s odd that your tree.html attachment is altered depending on how I view it through Gmail. If I download it to a file and open it with an editor, I see your code: <a href="?family=1" onclick="Element.toggle(''family1'');return(false);">Click me to open and close the sub list</a>... If I use the Google "View" link off the attachment, it opens the HTML in a separate window and when I do a "View Source" using Firefox development tools, the above <a> element comes out like this: <a href="http://?family=1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Click me to open and close the sub list</a> Weird. Initially, I only used View and thought it wasn''t using prototype...