Provides a way to sort and reorder a tree via drag&drop. Allows to expand or collapse a list or a tree. State can be saved in a Cookie.
This Plugin is part of MooTools PowerTools!.
Create a new instance of Tree
var tree = new Tree('unorderedList', options);
To serialize a tree you can use the 'serialize'-method
tree.serialize(); tree.serialize(fn); // You can also pass a custom function
The return value can then be encoded and sent to the server
Create a new instance of Collapse
var collapse = new Collapse('parentElement', options);
You can use both Tree and Collapse in conjunction. If you drag over a collapsed element, it will expand automatically after a short delay.
Create a new instance of Collapse.Cookie
var collapse = new Collapse.Cookie('parentElement', options);
Build via Packager, requires MooTools Core and MooTools Class-Extras to be registered to Packager already
packager register /path/to/tree packager build Tree/* > tree.js
To build this plugin without external dependencies use
packager build Tree/* +use-only Tree > tree.js
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.blog comments powered by Disqus