NOTICE: If you are using version 1.1.1 or lower, please note that the default list type has now
changed to <ol>
.
See Custom options and Changelog in the documentation below for more info.
Download full package (jQuery, jQuery UI, nestedSortable and demo page):
nestedSortable.1.2.1.zip
View the source code: jquery.ui.nestedSortable.js
If you want to talk about this plugin, or you have anything to tell me, please refer to
this post in the jQuery forum.
This plugin has also its place in the jQuery Plugin
Repository, which can be used for version and issue tracking.
toArray
method).
no-nesting
in the
above list).
<ul class="sortable"> <li><div>Some content</div></li> <li><div>Some content</div> <ul> <li><div>Some sub-item content</div></li> <li><div>Some sub-item content</div></li> </ul> </li> <li><div>Some content</div></li> </ul>
<div>
can be any tag (e.g. <span>
), but it has to be some tag. This
same tag has to be set as the 'toleranceElement' in the options, and this, or one of its children, as the
'handle'.
Any <li>
can have either one or two tags, the second being <ul>
.
tabSize
20
disableNesting
'ui-nestedSortable-no-nesting'
errorClass
'ui-nestedSortable-error'
listType
'ol'
(see changelog)
serialize
toArray
setName[n] => { 'item_id': itemId, 'parent_id': parentId, 'depth': depth, 'left': left, 'right': right, }looking at the items' id's as in
serialize
.startDepthCount
sets the starting depth number (default is 0), expression
is the regex used to extract the number from the item's id (default is the same as
serialize
).serialize
and toArray
work in IE6+ (In fact,
serialize
already worked, but it was badly implemented in this demo page).
<ol>
. Since we are dealing with ordering sets of items ordered lists are the way to go
according to HTML specifications.
toArray
method (right and left values have
been added, item_id and parent_id are now actual numbers).
serialize
and toArray
methods.
None that I know of.
serialize
and toArray
in order to have it show the
indentation level, somehow.maxItems
and maxLevels
options.
jQuery 1.4+
jQuery UI Sortable 1.8+
Tested with: IE 6, Firefox 3.6, Chrome 5, Safari 3
Will also work with: IE 6+, Firefox 3.5+, Chrome 4+, Safari 3+
Creative Commons CC Zero Declaration. No Rights Reserved. (But I will appreciate if you quote me)
© 2010 Manuele J Sarfatti