News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DotVoid.com:
Reordering nested sets using PHP and Javascript
September 14, 2007 @ 14:44:00

On the DotVoid blog today, Danne Lundqvist has posted about a problem he had - creating parent/child style data and displaying it as nested sets with the combination of PHP and Javascript. He outlines two different methods but only chooses one to run with.

The first method is "adjancency", a method that involves storing a parent ID in each node and recursing to find the related ones. He goes with a different solution, however - a "nested set". This method stores the data in terms of where it's located on the tree (layers from right, layers from left, etc).

Last night I was working on an application that display a full tree where the user must be able to to drag and drop nodes to reorder the tree. The problem is that it is much more difficult to insert or reorder the tree using the nested set model.

This was particularly effective in solving his problem, making a reogranizable listing that could be manipulated via a Javascript interface (the MooTree script from MooTools). Hi sPHP solution is included.

4 comments voice your opinion now!
javascript order list nested set adjancency method model javascript order list nested set adjancency method model


blog comments powered by Disqus

Similar Posts

Johan Mares' Blog: Running PHP CLI shell scripts

NETTUTS.com: 16 Vital Checks Before Releasing a WordPress Theme

Zend Developer Zone: Round\'em up, Head\'em out...Let\'s do a Framework Roundup!

Kevin Schroeder's Blog: ZendCon 2010 Podcasts

Sebastian Bergmann's Blog: AJAX-Based Test Runner for PHPUnit


Community Events





Don't see your event here?
Let us know!


unittest release refactor list testing laravel framework symfony2 introduction developer code podcast threedevsandamaybe opinion install series interview community language configure

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework