Browse Prior Art Database

System and methods to support dijit template inheritance in Dojo Disclosure Number: IPCOM000201317D
Publication Date: 2010-Nov-10
Document File: 4 page(s) / 24K

Publishing Venue

The Prior Art Database


The disclosed invention provides the system and methods to support the hypertext markup language (HTML) markup inheritance in Dojo (referring to products of the Dojo Foundation (1)) widget development such that the isA inheritance modeling can be utilized to design and implement Dojo widgets having a natural isA relationship.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 39% of the total text.

Page 01 of 4

System and methods to support dijit template inheritance in Dojo

Dojo Toolkit* is an open source modular JavaScript** library/toolkit designed to ease the rapid development of cross-platform, JavaScript/Ajax***-based applications and web sites. Dojo Toolkit is composed of three libraries:
· Dojo (the core building block)
· Dijit (short for "Dojo widget")
· Dojox (short for "Dojo eXtension")

Here, the Dijit library is Dojo Toolkit's widget framework and the focus of this invention.

A Dojo widget (dijit, hereafter) is a user interface encapsulation which supports Web application development built by components. The Dijit framework supports inheritance where a base dijit can be extended into derived and customized dijits. Since a dijit is composed of hypertext markup language (HTML) markup, cascading style sheet (CSS), and JavaScript code, one may assume that dijit inheritance framework supports the inheritance at all levels. However, in actuality, the dijit inheritance framework lacks the inheritance support at HTML mockup (including dijit markup) level. This forces dijit developers to either copy the base dijit's HTML markup into the derived dijit or take the hasA approach to model an isA inheritance relationship to reuse the base dijit's HTML markup. As a result, dijit development typically suffers from markup maintenance cost (multiple base dijit HTML markup copies) and mismatched modeling (hasA for isA).

This invention provides the system and methods to enable isA inheritance modeling and realization at dijit's HTML mockup (including dijit markup) level. The invention uses a dynamic template merging mechanism which allows the dijit designer to describe the final derived dijit HTML mockup in terms of the base dijit's HTML markup and the derived dijit's skeleton HTML mockup.

To describe the problem and the solution provided by this invention, this disclosure introduces the dijit.

_Templated mixin is the key to the dijit

template framework that associates a dijit's HTML markup with the code using HTML dijit markup substitution, attach points and event points and some dijit


_Template, which provide a dijit's basic life

cycle methods/properties. Within the dijit declaration, the "templatePath" property is used to tell the dijit framework where to find the dijit's corresponding HTML markup (also called template).

The following is an example of the Base dijit which will also be used as the base dijit for the Derived dijit later:



dojo.declare("invention.Base", [dijit.


Templated mixin. The dijit.


essential properties in the code.

A dijit inherits from dijit.

_Widget and dijit.



Widget, dijit.

_Templated], {


Page 02 of 4

widgetsInTemplate: true,

    templatePath: dojo.moduleUrl("invention", "./Base.html"), // Where the HTML mock file is located

postCreate: function() {
this.baseChildNode.innerHTML = "base child node content modif...