How to create a sortable, drag and drop layered list in Javascript

I am trying to create a layered list that can be sorted by drag and drop. The user can grab an element and move it up and down the tree or move it to other elements and become a child.

Are there any JS solutions on the shelf? JQuery sortable / draggable works fine for one level, but less for nested solutions.

+5
source share
4 answers

I searched nested sortable javascript jqueryand found many results.

Nr. in my opinion http://mjsarfatti.com/sandbox/nestedSortable/

Try it yourself!

+6
source

johnny jquery-sortable plugin, http://johnny.imtqy.com/jquery-sortable.

, .

AJAX. . , , ( ).

, .

+2

https://github.com/dbushell/Nestable http://johnny.imtqy.com/jquery-sortable

You might want to upgrade to something like React these days so you can use packages like this: https://www.npmjs.com/package/react-drag-sortable

Try not to use jQuery for this kind of thing anymore. By the time you get the drag and drop interfaces, you already have a web application, not a web page, and you are going in the wrong direction.

0
source

All Articles