📜 ⬆️ ⬇️

Sortable nested list with selectable items

We learn nested lists to behave like files and folders.
image

In my free time, I am writing another killer of browser bookmarks (probably the jubilee one, one hundred and five hundredth) , which required working with nested lists. The runaway googling did not give out the finalist (the closest, perhaps, nestedSortable ) , so I decided to write my bicycle.

The task of the bike is simple: to simplify the work with the elements as much as possible without breaking the page behavior. Teaching people new things is worth it, so I tried to make the list work as closely as possible with files and folders.

In my opinion it turned out well; With the thought that the result might be useful to someone else, I pulled the methods into a separate module and laid it out on the github. JQuery is used.
')
From good:
• selection area
• ctrl and shift behavior close to pc
• movement up and down arrows
• unlimited nesting (within reason)
• easy to add your push button behavior
• it is relatively easy to isolate part of the functionality.
• multiple listings per page

From sad:
• difficult to adapt
• may contain errors
• no update is planned (corrected errors will be corrected, pull requests are welcome)

Repository , demo and one more .

Source: https://habr.com/ru/post/275109/


All Articles