October 2006
Intermediate to advanced
288 pages
5h 55m
English
The Tree object is the powerhouse in this component because it parses the response data that is received from the TreeManager object and creates a tree structure that is later appended to an HTML element or the HTML document body by TreeManager. In other words, this object pretty much does it all. The object is a prototype, which means it can be instantiated, and contains a constructor function. Listing 11.5 shows the code snippet for this constructor.
function Tree(data)
{
this.data = data;
this.childArray = new Array();
this.tree = '';
}
|
The tree object’s constructor takes a data parameter, which is the response data from TreeManager, and sets the data to a local property ...
Read now
Unlock full access