nestedSortable

A jQuery plugin that extends Sortable UI functionalities to nested lists.

  • 所有者: mjsarfatti/nestedSortable
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

29 July 2014

nestedSortable is currently maintained at ilikenwf/nestedSortable. Please go there.

DEVELOPER NEEDED
I'm sorry to say that I am not able to keep the pace developing this project anymore. I know how much nestedSortable is important for web applications, and I still can't understand why it's not part of jQuery-UI. I also think the base of the plugin is very strong, and deserves much more attention and involvement. If anybody is willing to take this project, please say so here.
Thank you.

nestedSortable jQuery plugin

nestedSortable is a jQuery plugin that extends jQuery Sortable UI functionalities to nested lists.
Note: Version 2.0 is published in branch '2.0alpha' and is ready for testing! At the moment it has only been tested in Firefox and Chrome, if you work with IE feel free to give it a shot and let me know if something goes wrong.

Features

  • Designed to work seamlessly with the nested set model (have a look at the toArray method)
  • Items can be sorted in their own list, moved across the tree, or nested under other items.
  • Sublists are created and deleted on the fly
  • All jQuery Sortable options, events and methods are available
  • It is possible to define elements that will not accept a new nested item/list and a maximum depth for nested items
  • The root level can be protected

Usage

<ol class="sortable">
	<li><div>Some content</div></li>
	<li>
		<div>Some content</div>
		<ol>
			<li><div>Some sub-item content</div></li>
			<li><div>Some sub-item content</div></li>
		</ol>
	</li>
	<li><div>Some content</div></li>
</ol>
	$(document).ready(function(){

		$('.sortable').nestedSortable({
			handle: 'div',
			items: 'li',
			toleranceElement: '> div'
		});

	});

Please note: every <li> must have either one or two direct children, the first one being a container element (such as <div> in the above example), and the (optional) second one being the nested list. The container element has to be set as the 'toleranceElement' in the options, and this, or one of its children, as the 'handle'.

Also, the default list type is <ol>.

Custom Options

Custom Methods

Known Bugs

nestedSortable doesn't work properly with connected draggables, because of the way Draggable simulates Sortable mouseStart and mouseStop events. This bug might or might not be fixed some time in the future (it's not specific to this plugin).

Requirements

jQuery 1.4+
jQuery UI Sortable 1.8+

Browser Compatibility

Tested with: IE 6/7/8, Firefox 3.6/4, Chrome, Safari 3

License

This work is licensed under the MIT License.

This work is pizzaware. If it saved your life, or you just feel good at heart, please consider offering me a pizza. This can be done in two ways: (1) follow this link to donate through paypal; (2) send me cash via traditional mail to my home address in Italy. Is the second method legal? It is in Italy if you use Posta assicurata. You should check with your local laws if you live elsewhere.

主要指標

概覽
名稱與所有者mjsarfatti/nestedSortable
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證
所有者活动
創建於2011-04-26 14:23:10
推送於2018-06-13 07:51:52
最后一次提交2014-07-29 11:21:31
發布數2
最新版本名稱v1.3.4 (發布於 2011-04-28 23:48:58)
第一版名稱v1.3.3 (發布於 2011-04-26 16:36:55)
用户参与
星數880
關注者數73
派生數529
提交數42
已啟用問題?
問題數88
打開的問題數21
拉請求數12
打開的拉請求數9
關閉的拉請求數22
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?