Tree Model"
From Documentation
m |
m |
||
Line 7: | Line 7: | ||
Instead of implementing <javadoc type="interface">org.zkoss.zul.TreeModel</javadoc> from scratch, it is suggested to extend from <javadoc>org.zkoss.zul.AbstractTreeModel</javadoc>, which will handle the data listeners transparently. | Instead of implementing <javadoc type="interface">org.zkoss.zul.TreeModel</javadoc> from scratch, it is suggested to extend from <javadoc>org.zkoss.zul.AbstractTreeModel</javadoc>, which will handle the data listeners transparently. | ||
− | In additions, if the tree is small enough to be loaded completely, you could use the default implementation, <javadoc>org.zkoss.zul.SimpleTreeModel</javadoc>, which uses <javadoc>org.zkoss.zul.SimpleTreeNode</javadoc> to construct a tree. | + | In additions, if the tree is small enough to be loaded completely, you could use the default implementation, <javadoc>org.zkoss.zul.SimpleTreeModel</javadoc>, which uses <javadoc>org.zkoss.zul.SimpleTreeNode</javadoc> to construct a tree, and it assumes the tree is immutable. |
=Version History= | =Version History= |
Revision as of 05:05, 3 January 2011
Here we describe how to implement a tree model (TreeModel). For the concept about component, model and render, please refer to the Model-driven Display section.
A tree model is used to control how to display a tree-like component, such as Tree.
Instead of implementing TreeModel from scratch, it is suggested to extend from AbstractTreeModel, which will handle the data listeners transparently.
In additions, if the tree is small enough to be loaded completely, you could use the default implementation, SimpleTreeModel, which uses SimpleTreeNode to construct a tree, and it assumes the tree is immutable.
Version History
Version | Date | Content |
---|---|---|