Servis-Rhino 4211B Betriebsanweisung Seite 190

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 298
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 189
xstyle
put-selector
The Tree
Dojo provides an elegant tree Widget that can show hierarchical data. The core of the tree is a Dijit
widget called dijit/Tree. This provides the visual representation of the tree in the browser.
The tree however does not own the data. It merely provides a visualization of the model of the data.
The data itself is owned by an object that implements the tree model.
The data folders shown in the tree can be opened and closed.
See also
Docs – dijit/Tree – 1.9
Docs – dijit/Tree examples – 1.9
Connecting a Store to a Tree
developerWorks - Comment lines: Scott Johnson: Lazily loading your Dojo Dijit tree widget can improve performance - 2008-05-14
dijit/Tree
The construction of a tree merely needs a data object that contains the data to be shown in the tree.
This is contained in the dijit/tree/ObjectStoreModel.
var myTree = new Tree({model: myModel});
myTree.placeAt(myNode);
myTree.startup();
When an element in the tree is selected, its "onClick(item)" method is invoked. The item
passed is the entry in the tree that was selected.
To only allow single selections, the following fragment can be used:
myTree.dndController.singular = true;
The icons shown in the tree are created by providing a class name for the image. The class name
can be overridden by providing your own implementation of the getIconClass(item)
function. This is passed an item as a parameter and should return the name of the class to use.
Some of the more useful properties of dijit/Tree are:
showRoot – A boolean. If set to false, the root of the tree is not shown in the tree
visualization. Of course it still exists within the model.
selectedItems – A list of the selected items in the tree.
Some of the more useful methods are:
getTooltip(item) – This method returns a tooltip for the item in the tree. It should
return a string.
See also:
dijit/tree/ObjectStoreModel
Connecting a store to a tree – 1.9
Page 190
Seitenansicht 189
1 2 ... 185 186 187 188 189 190 191 192 193 194 195 ... 297 298

Kommentare zu diesen Handbüchern

Keine Kommentare