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

Widgets in Alloy UI

A widget is a self-contained UI unit. In this section, we will talk about a TreeView instance, which is a widget. The TreeView class extends the TreeData class, which in turn extends the Base class. The TreeView class provides the widget lifecycle.

Here is the code for a TreeView widget:

<div id="markupBoundingBox">
widget, Alloy UITreeView widget<ul id="markupContentBox">
<li>
<span>folder</span>
<ul>
// ignore details
</ul>
</div>
// ignore details
AUI().ready('aui-tree-view', function(A) {
var treeView = new A.TreeView({
boundingBox: '#markupBoundingBox',
contentBox: '#markupContentBox'
}).render();
});

In this snippet of code, the ready method waits until all the DOM elements on the page are ready. It populates the sandbox ...

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