Constructordijit.tree.TreeStoreModel

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

passed the arguments listed above (store, etc)

Usage

function (/*Object*/ args) (view source)
parametertypedescription
argsObject 

Examples

Example 1

{id:'ROOT'}

Jump to PropertiesFunctionsBack to top

FunctiongetChildren(parentItem, onComplete, onError: Function)
Calls onComplete() with array of child items of given parent item, all loaded.
FunctiongetLabel(item)
get the label for an item
FunctiongetRoot(onItem, onError)
Calls onItem with the root item for the tree, possibly a fabricated item. Calls onError 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. Used in drag & drop when item from external source dropped onto tree.
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
handler for delete notifications from underlying store
Function_onNewItem(item, parentInfo: Object)
handler for when new items appear in the store.
Function_onSetItem(item, attribute, oldValue: Object|Array, newValue: Object|Array)
set data event on an item in the store

Jump to FunctionsPropertiesBack to top

one ore more attributes that holds children of a tree node
Specifies datastore query to return the root item for the tree. Must only return a single item. Alternately can just pass in pointer to root item.
Pointer to the root item (read only, not a parameter)