O'Reilly logo

Liferay User Interface Development by Frank Yu, Xinsheng Chen, Jonas X. Yuan

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

Drag and drop

Drag-and-drop is common in a web application. Alloy UI has a Drag class for implementing this feature.

<div id="demo_drag">Drag Me</div>
// ignore details
AUI().use('dd', 'node', function(A) {
var dd = new A.DD.Drag({
node: '#demo_drag'
});
});

The<div> block with an ID of demo_drag is the container for the drag-and-drop instance. The previous code snippet loads dd and node modules into the sandbox first. dd means drag-and-drop. Then an A.DD.Drag object is instantiated. Its configuration object argument has a node attribute. Its value is the ID of the container.

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