views:

37

answers:

1

Hi, does anyone know about a jquery plugin that is able to sort a parent/child tree? for ex:

- Cat 1
    child 1
    child 2
    child 3
- Cat2
    child 2-1
    child 2-2

i have to sort the child items inside the SAME Cat and save the order to DB with AJAX. Also, i need to sort Cat aswell. In that case, all the child items should follow it's parent Cat. Does anyone know a plugin that does this? Thank you

A: 

Your question is confusing. Do you want to sort the entire list, then resort after you drag and drop a child? There are many answers on sorting, you will have to adapt them to suit your needs:

  1. http://stackoverflow.com/questions/304396/what-is-the-easiest-way-to-order-a-ul-ol-in-jquery
  2. http://stackoverflow.com/questions/1134976/jquery-sort-list-items-alphabetically
  3. or check out Tinysort.
fudgey