O'Reilly logo

Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites by Gigi Sayfan, Kevin Dangoor, Mark Ramm

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15.3.8. Sortables and DragAndDrop

One call to Sortable.create packs a lot of power! Sortable.create(element[, options]) takes an element (generally a ul) and a variety of options. Many of the options come straight from the DragAndDrop package, on which Sortable builds. Let’s talk about the lower-level DND package before getting to the details of Sortable.

DND provides you with two kinds of objects: Draggables and Droppables. They have the familiar-looking signatures new Draggable(element[, options]) and new Droppable(element[, options]). To allow an element to be picked up and dragged around the page is as simple as new Draggable(‘elementid’). However, you might want to change a number of options that affect the draggable’s behavior. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required