|
|
|
_requeryTop(
) :
void
|
|
|
|
applyQuery(
query
: Object
queryOptions
: Object
sort
: Object
) :
void
Parameter |
Type |
Usage |
Description |
query |
Object |
required |
|
queryOptions |
Object |
optional |
|
sort |
Object |
optional |
|
|
|
|
|
constructor(
params
) :
void
Sets up variables, etc.
Parameter |
Type |
Usage |
Description |
params |
|
required |
|
|
|
|
|
destroy(
) :
void
|
|
|
|
fetchItemByIdentity(
keywordArgs
: object
) :
void
Parameter |
Type |
Usage |
Description |
keywordArgs |
object |
required |
|
|
|
|
|
getChildren(
parentItem
: dojo.data.Item
callback
: function(items)
onError
: function
) :
void
Calls onComplete() with array of child items of given parent item, all loaded.
Parameter |
Type |
Usage |
Description |
parentItem |
dojo.data.Item |
required |
|
callback |
function(items) |
required |
|
onError |
function |
required |
|
|
|
|
|
getIdentity(
item
: item
) :
void
Parameter |
Type |
Usage |
Description |
item |
item |
required |
|
|
|
|
|
getLabel(
item
: item
) :
void
Get the label for an item
Parameter |
Type |
Usage |
Description |
item |
item |
required |
|
|
|
|
|
getRoot(
onItem
onError
) :
void
Calls onItem with the root item for the tree, possibly a fabricated item.
Calls onError on error.
Parameter |
Type |
Usage |
Description |
onItem |
|
required |
|
onError |
|
required |
|
|
|
|
|
isItem(
something
: anything
) :
void
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.
Used in drag & drop when item from external source dropped onto tree.
Developers will need to override this method if new items get added
to parents with multiple children attributes, in order to define which
children attribute points to the new item.
Parameter |
Type |
Usage |
Description |
args |
dojo.dnd.Item |
required |
|
parent |
Item |
required |
|
insertIndex |
int |
optional |
|
|
|
|
|
onAddToRoot(
item
: item
) :
void
Called when item added to root of tree; user must override this method
to modify the item so that it matches the query for top level items
Parameter |
Type |
Usage |
Description |
item |
item |
required |
|
Examples
|
|
|
|
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 |
|
|
|
|
|
onDelete(
parent
: dojo.data.Item
newChildrenList
: dojo.data.Item[]
) :
void
Callback when an item has been deleted.
Note that there will also be an onChildrenChange() callback for the parent
of this item.
Parameter |
Type |
Usage |
Description |
parent |
dojo.data.Item |
required |
|
newChildrenList |
dojo.data.Item[] |
required |
|
|
|
|
|
onDeleteItem(
item
: Object
) :
void
Handler for delete notifications from underlying store
Parameter |
Type |
Usage |
Description |
item |
Object |
required |
|
|
|
|
|
onLeaveRoot(
item
: item
) :
void
Called when item removed from root of tree; user must override this method
to modify the item so it doesn't match the query for top level items
Parameter |
Type |
Usage |
Description |
item |
item |
required |
|
Examples
|
|
|
|
onNewItem(
item
: dojo.data.Item
parentInfo
: Object
) :
void
Handler for when new items appear in the store. Developers should override this
method to be more efficient based on their app/data.
Note that the default implementation requeries the top level items every time
a new item is created, since any new item could be a top level item (even in
addition to being a child of another item, since items can have multiple parents).
Developers can override this function to do something more efficient if they can
detect which items are possible top level items (based on the item and the
parentInfo parameters). Often all top level items have parentInfo==null, but
that will depend on which store you use and what your data is like.
Parameter |
Type |
Usage |
Description |
item |
dojo.data.Item |
required |
|
parentInfo |
Object |
required |
|
|
|
|
|
onNewRootItem(
args
) :
void
User can override this method to modify a new element that's being
added to the root of the tree, for example to add a flag like root=true
Parameter |
Type |
Usage |
Description |
args |
|
required |
|
|
|
|
|
onSetItem(
item
: item
attribute
: attribute-name-string
oldValue
: object
newValue
: object
) :
void
Updates the tree view according to changes in the data store.
Handles updates to an item's children by calling onChildrenChange(), and
other updates to an item by calling onChange().
See `onNewItem` for more details on handling updates to an item's children.
Parameter |
Type |
Usage |
Description |
item |
item |
required |
|
attribute |
attribute-name-string |
required |
|
oldValue |
object |
required |
| array |
newValue |
object |
required |
| array |
|
|
|
|
pasteItem(
childItem
: Item
oldParentItem
: Item
newParentItem
: Item
bCopy
: Boolean
insertIndex
: int
) :
void
Move or copy an item from one parent item to another.
Used in drag & drop
Parameter |
Type |
Usage |
Description |
childItem |
Item |
required |
|
oldParentItem |
Item |
required |
|
newParentItem |
Item |
required |
|
bCopy |
Boolean |
required |
|
insertIndex |
int |
optional |
|
|