Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 62da276a79
Fetching contributors…

Cannot retrieve contributors at this time

executable file 70 lines (54 sloc) 3.228 kb


since: V1.7 (dojox/app/view)

dojox/app/View module provides a View class to construct View instances, a template rendering engine to render view template and view lifecycle APIs. Each View can have one parent view and optionally several children views. It provides a templated container to host the domNodes for the children views. Its purpose is to allow the layout of the view to be provided through an html template and to have a set of children views which the view transitions between. For example, to display a set of tabs, you would use a View with a child view for each tab. The view's template would define where within the view the children views are displayed and where any tab buttons and such are displayed. In this case the "template", for the base View is pretty simple. It is a simple HTML content. However, nodes within the template can be tagged with data-app-region="top" (bottom, left, right) to define where that node and its children should be displayed.

For example:

This template for the tabs view defines two areas with region top, a header and the tab buttons. The will be placed at the top of this main view when rendered.

Normally, when using a BorderContainer, one would also have a data-app-region="center" section. In the case of a View however, the "center" region will be applied to the currently active view (the current tab for example).

The application can also provide view definition modules to implement the View lifecyle APIs (like init(), destroy(),...). This module can act as a view controller, synchronizing the data between the model and the view.

For example:

Something went wrong with that request. Please try again.