I have tried for some time to work out a way of sorting nested categories with jQuery. I failed to build my own plugin to do this, so I tried to find something that were available already. Tried a few hours now with this one, http://www.jordivila.net/code/js/jquery/ui-widgetTreeList_inheritance/widgetTreeListSample.aspx and cant get it to work.
What are the alternatives of creating a jQuery / jQuery UI script that handles sorting children and parent categories in a way that can be combined with a AJAX PHP backend to handle the actual sorting in the database?
Thanks!
You could try structuring your hierarchical data in your database using the Nested Set Model, it will allow you to simply query your categories in order of their depth using single SELECT
Here is an article from MySQL describing how it is implemented in a relational database http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With