Constructordijit.tree.model

dojo.require("dijit._tree.model");
defined in dijit/_tree/model.js

Contract for any data provider object for the tree. Tree passes in values to the constructor to specify the callbacks. "item" is typically a dojo.data.Item but it's just a black box so it could be anything. This (like dojo.data.api.Read) is just documentation, and not meant to be used.

Usage

function ()

FunctionsBack to top

destroys this object, releasing connections to the store
FunctiongetChildren(parentItem, onComplete)
Calls onComplete() with array of child items of given parent item, all loaded. Throws exception on error.
returns identity for an item
FunctiongetLabel(item)
get the label for an item
FunctiongetRoot(onItem)
Calls onItem with the root item for the tree, possibly a fabricated item. Throws exception on error.
Tells if an item has or may have children. Implementing logic here avoids showing +/- expando icon for nodes that we know don't have children. (For efficiency reasons we may not want to check if an element actually has children until user clicks the expando node)
FunctionnewItem(args: Object?, parent)
Creates a new item. See dojo.data.api.Write for details on args.
FunctiononChange(item)
Callback whenever an item has changed, so that Tree can update the label, icon, etc. Note that changes to an item's children or parent(s) will trigger an onChildrenChange() so you can ignore those changes here.
FunctiononChildrenChange(parent, newChildrenList)
Callback to do notifications about new, updated, or deleted items.
FunctionpasteItem(childItem, oldParentItem, newParentItem, bCopy: Boolean)
Move or copy an item from one parent item to another. Used in drag & drop. If oldParentItem is specified and bCopy is false, childItem is removed from oldParentItem. If newParentItem is specified, childItem is attached to newParentItem.