sortable($options = array())
Sortable generates a javascript snippet to make a set of elements
(usually a list) drag and drop sortable.
The normalized options are:
Options
•containment - Container for move action
•handle - Selector to handle element. Only this element will
start sort action.
•revert - Whether or not to use an effect to move sortable
into final position.
•opacity - Opacity of the placeholder
•distance - Distance a sortable must be dragged before
sorting starts.
Event Options
•start - Event fired when sorting starts
•sort - Event fired during sorting
•complete - Event fired when sorting completes.
Other options are supported by each Javascript library, and you
should check the documentation for your javascript library for more
detailed information on its options and parameters.
Example use:
$js->get('#my-list');
$js->sortable(array(
'distance' => 5,
'containment' => 'parent',
'start' => 'onStart',
'complete' => 'onStop',
'sort' => 'onSort',
'wrapCallbacks' => false
));
Assuming you were using the jQuery engine, you would get the
following code in your generated Javascript block:
$("#myList").sortable({containment:"parent", distance:5,
sort:onSort, start:onStart, stop:onStop});