O'Reilly logo

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

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

Getting familiar with Node and Nodelist

Node is the interface for DOM operations in Alloy UI. The Node API is based on the DOM API. Additionally, Node has properties and methods that make its manipulation easier—it is a wrapped DOM element.

Nodelist is used for the manipulation of a collection of elements.

To manipulate Node, we must put our JavaScript code in a sandbox as follows:

  AUI().use('node', function(A) {
    var aNode = A.one('#demo');
});

The Alloy UI sandbox is the same as the YUI sandbox, as we have studied in the YUI3 section in this chapter. AUI() creates an instance of the AUI class. The use method loads the node module including all the required JavaScript files into the context. The function(A) method is a callback method. Its only argument, ...

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