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.
|
|
|
destroy(
) :
void
Destroys this object, releasing connections to the store
|
|
|
|
fetchItemByIdentity(
keywordArgs
: object
) :
void
Given the identity of an item, this method returns the item that has
that identity through the onItem callback. Conforming implementations
should return null if there is no item with the given identity.
Implementations of fetchItemByIdentity() may sometimes return an item
from a local cache and may sometimes fetch an item from a remote server.
Parameter |
Type |
Usage |
Description |
keywordArgs |
object |
required |
|
|
|
|
|
getChildren(
parentItem
: dojo.data.Item
onComplete
: function(items)
) :
void
Calls onComplete() with array of child items of given parent item, all loaded.
Throws exception on error.
Parameter |
Type |
Usage |
Description |
parentItem |
dojo.data.Item |
required |
|
onComplete |
function(items) |
required |
|
|
|
|
|
getIdentity(
item
: item
) :
void
Returns identity for an item
Parameter |
Type |
Usage |
Description |
item |
item |
required |
|
|
|
|
|
getLabel(
item
: dojo.data.Item
) :
void
Get the label for an item
Parameter |
Type |
Usage |
Description |
item |
dojo.data.Item |
required |
|
|
|
|
|
getRoot(
onItem
) :
void
Calls onItem with the root item for the tree, possibly a fabricated item.
Throws exception on error.
Parameter |
Type |
Usage |
Description |
onItem |
|
required |
|
|
|
|
|
isItem(
something
: anything
) :
void
Returns true if *something* is an item and came from this model instance.
Returns false if *something* is a literal, an item from another model instance,
or is any object other than an item.
Parameter |
Type |
Usage |
Description |
something |
anything |
required |
|
|
|
|
|
mayHaveChildren(
item
: dojo.data.Item
) :
void
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)
Parameter |
Type |
Usage |
Description |
item |
dojo.data.Item |
required |
|
|
|
|
|
newItem(
args
: dojo.dnd.Item
parent
: Item
insertIndex
: int
) :
void
Creates a new item. See dojo.data.api.Write for details on args.
Parameter |
Type |
Usage |
Description |
args |
dojo.dnd.Item |
required |
|
parent |
Item |
required |
|
insertIndex |
int |
optional |
|
|
|
|
|
onChange(
item
: dojo.data.Item
) :
void
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.
Parameter |
Type |
Usage |
Description |
item |
dojo.data.Item |
required |
|
|
|
|
|
onChildrenChange(
parent
: dojo.data.Item
newChildrenList
: dojo.data.Item[]
) :
void
Callback to do notifications about new, updated, or deleted items.
Parameter |
Type |
Usage |
Description |
parent |
dojo.data.Item |
required |
|
newChildrenList |
dojo.data.Item[] |
required |
|
|
|
|
|
pasteItem(
childItem
: Item
oldParentItem
: Item
newParentItem
: Item
bCopy
: Boolean
) :
void
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.
Parameter |
Type |
Usage |
Description |
childItem |
Item |
required |
|
oldParentItem |
Item |
required |
|
newParentItem |
Item |
required |
|
bCopy |
Boolean |
required |
|
|