user347033
user347033

Reputation: 93

jQuery drag an drop sort list parent/child

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

Upvotes: 0

Views: 2321

Answers (2)

Fenton
Fenton

Reputation: 251172

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.

Upvotes: 1

Mottie
Mottie

Reputation: 86453

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.

Upvotes: 1

Related Questions