]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dijit/_tree/model.js
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dijit / _tree / model.js
1
2 dojo.declare(
3         "dijit.tree.model",
4         null,
5 {
6         // summary
7         //              Contract for any data provider object for the tree.  Tree 
8         //              passes in values to the constructor to specify the callbacks.
9         //              "item" is typically a dojo.data.Item but it's just a black box so
10         //              it could be anything.
11         //
12         //              This (like dojo.data.api.Read) is just documentation, and not meant to be used.
13         
14         destroy: function(){
15                 // summary: destroys this object, releasing connections to the store
16         },
17         
18         // =======================================================================
19         // Methods for traversing hierarchy
20         
21         getRoot: function(onItem){
22                 // summary:
23                 //              Calls onItem with the root item for the tree, possibly a fabricated item.
24                 //              Throws exception on error.
25         },
26         
27         mayHaveChildren: function(/*dojo.data.Item*/ item){
28                 // summary
29                 //              Tells if an item has or may have children.  Implementing logic here
30                 //              avoids showing +/- expando icon for nodes that we know don't have children.
31                 //              (For efficiency reasons we may not want to check if an element actually
32                 //              has children until user clicks the expando node)
33         },
34         
35         getChildren: function(/*dojo.data.Item*/ parentItem, /*function(items)*/ onComplete){
36                 // summary
37                 //              Calls onComplete() with array of child items of given parent item, all loaded.
38                 //              Throws exception on error.
39         },
40         
41         // =======================================================================
42         // Inspecting items
43         
44         getIdentity: function(/* item */ item){
45                 // summary: returns identity for an item
46         },
47         
48         getLabel: function(/*dojo.data.Item*/ item){
49                 // summary: get the label for an item
50         },
51         
52         // =======================================================================
53         // Write interface
54         
55         newItem: function(/* Object? */ args, /*Item?*/ parent){
56                 // summary
57                 //              Creates a new item.   See dojo.data.api.Write for details on args.
58         },
59         
60         pasteItem: function(/*Item*/ childItem, /*Item*/ oldParentItem, /*Item*/ newParentItem, /*Boolean*/ bCopy){
61                 // summary
62                 //              Move or copy an item from one parent item to another.
63                 //              Used in drag & drop.
64                 //              If oldParentItem is specified and bCopy is false, childItem is removed from oldParentItem.
65                 //              If newParentItem is specified, childItem is attached to newParentItem.
66         },
67         
68         // =======================================================================
69         // Callbacks
70         
71         onChange: function(/*dojo.data.Item*/ item){
72                 // summary
73                 //              Callback whenever an item has changed, so that Tree
74                 //              can update the label, icon, etc.   Note that changes
75                 //              to an item's children or parent(s) will trigger an
76                 //              onChildrenChange() so you can ignore those changes here.
77         },
78         
79         onChildrenChange: function(/*dojo.data.Item*/ parent, /*dojo.data.Item[]*/ newChildrenList){
80                 // summary
81                 //              Callback to do notifications about new, updated, or deleted items.
82         }
83 });
84