0

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

user347033
  • 93
  • 1
  • 1
  • 4

2 Answers2

1

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. What is the easiest way to order a <UL>/<OL> in jQuery?
  2. How may I sort a list alphabetically using jQuery?
  3. or check out Tinysort.
Community
  • 1
  • 1
Mottie
  • 84,355
  • 30
  • 126
  • 241
1

There is a jQuery plugin for drag and drop sort...

http://plugins.jquery.com/project/draganddropsort

I'm not sure whether it deals with the tree-view of options or not... I suspect it could if required! It certainly allows you to turn any collection of HTML elements into a sortable section.

Fenton
  • 241,084
  • 71
  • 387
  • 401