<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 19 May 2013 02:06:12 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DotVoid.com: Reordering nested sets using PHP and Javascript]]></title>
      <guid>http://www.phpdeveloper.org/news/8658</guid>
      <link>http://www.phpdeveloper.org/news/8658</link>
      <description><![CDATA[<p>
On the DotVoid blog today, <i>Danne Lundqvist</i> has <a href="http://www.dotvoid.com/view.php?id=78">posted about a problem</a> 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.
</p>
<p>
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).
</p>
<blockquote>
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.
</blockquote>
<p>
This was particularly effective in solving <a href="http://www.dotvoid.com/view.php?id=78">his problem</a>, making a reogranizable listing that could be manipulated via a Javascript interface (the <a href="http://youmuppet.com/?page_id=9">MooTree</a> script from <a href="http://www.mootools.net/">MooTools</a>). Hi sPHP solution is included.
</p>]]></description>
      <pubDate>Fri, 14 Sep 2007 14:44:00 -0500</pubDate>
    </item>
  </channel>
</rss>
