#2 new
Sean Templeton

Add $js->sortable()

Reported by Sean Templeton | January 30th, 2010 @ 12:02 AM | in DojoCake 1.3.2

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});

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Dojo Cake is a library of CakePHP helpers and controllers to make the process of adding Dojo to CakePHP more easy. The library includes helpers for widgets and XHR connections.
Dojo Cake was developed to make the process of making ajax applications in CakePHP as easy as making the application itself, making Web 2.0 applications in CakePHP a piece of cake (pun intended). With a growing number of widgets, and support for basic ajax and xhr connections, Dojo Cake aims to be a powerful link between clientside programming and server-side programming.
The project is hosted on google code at http://dojocake.googlecode.com

Shared Ticket Bins

People watching this ticket

Pages