Class idx.widget.NavTree
Extends
dijit.Tree.
Widget for sidebar navigation via a tree control. This adds badges,
selectability, node types and other features to the basic dijit Tree.
Defined in: <idx\widget\NavTree.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Field Summary
Field Attributes | Field Name and Description |
---|---|
An associative map that maps the string badge types to the icon class to use for that
badge type.
|
|
Prefix to use for looking up labels for items in the specified resources.
|
|
Suffix to use for looking up labels for badges in the specified resources.
|
|
Inherit the base class from the parent class.
|
|
Indiciates whether or not the selection should be highlighted.
|
|
An associative map that maps the node/item type to the icon class to use for that type.
|
|
Override the base class.
|
|
Prefix to use for looking up labels for items in the specified resources.
|
|
Suffix to use for looking up labels for items in the specified resources.
|
|
Set this to true to use the non-numeric badge labels as the basis for
"label" keys for looking up the labels to display in the tree items
from resources.
|
|
Set this to true to use the item labels as the basis for "label" keys
for looking up the labels to display in the tree items from resources.
|
|
The resources for this instance.
|
|
Indicates whether or not to show badges.
|
|
Indicates whether or not to show icons adjacent to items.
|
|
Indicate that the root of the tree should not be shown since our
navigation tree will have multiple roots.
|
|
Sets the template string used by the navigation tree.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
Override buildRendering() to update the CSS classes in the DOM.
|
|
getBadgeIconClass(item, opened)
Provides the badge icon class to use (if any).
|
|
getBadgeLabel(item)
Obtains the badge label to use for the item.
|
|
getIconClass(item, opened)
Overridden to leverage the "iconMap" attribute and the item type classifications.
|
|
getLabel(item)
Override to try to use the label prefix/suffix.
|
|
normalizeItem(item)
Pass-through method to the underlying NavTreeModel to request that it
normalize the item for direct use.
|
|
onClick(item, node, evt)
Override to trigger calling the "onSelectionChanged" function when a new node is selected.
|
|
onSelectionChanged(items, nodes, tree, evt)
Called when the selection changes with an array of items that is paired
with an array of nodes and a reference to the tree itself.
|
|
Override to modify the "dndParams" to force "singular" selection behavior.
|
|
Overrides dijit._Widget.postMixInProperties() to ensure
that the dijit._Widget.attr() function is called for each
property that was set.
|
Field Detail
badgeIconMap
An associative map that maps the string badge types to the icon class to use for that
badge type. Format of the specified object should be as follows:
{
"type1": "iconClass1",
"type2": "iconClass2",
"type3": {leaf: "leafIconClass3", branch: "branchIconClass3"},
"type4": {leaf: "leafIconClass4", open: "openIconClass4", closed: "closedIconClass4"},
"type4": null
}
The keys in the associative map take the form of the string type badge names while the values
may either be simple strings indicating the icon class or an object representing different
a "leaf" badge icon class and a "branch" badge icon class where the choice of which depends
on whether or not the item has children. Finally, the value may be null to indicate that
no icon should be used for that badge type.
badgeLabelKeyPrefix
Prefix to use for looking up labels for items in the specified resources.
If this is not set then the value is obtained from idx.resources using the
key "badgeLabelKeyPrefix".
badgeLabelKeySuffix
Suffix to use for looking up labels for badges in the specified resources.
If this is not set then the value is obtained from idx.resource using the
key "badgeLabelKeySuffix".
baseClass
Inherit the base class from the parent class.
highlightSelection
Indiciates whether or not the selection should be highlighted. If this is true then
"idxNavTreeHighlight" class is applied to the base node, otherwise "idxNavTreeNoHighlight"
is applied. Usuaully when the selection is not highlighted it is still indicated in some
other way (e.g.: an adjacent dot and bold text).
iconMap
An associative map that maps the node/item type to the icon class to use for that type.
Format of the specified object should be as follows:
{
"type1": "iconClass1",
"type2": "iconClass2",
"type3": {leaf: "leafIconClass3", branch: "branchIconClass3"},
"type4": {leaf: "leafIconClass4", open: "openIconClass4", closed: "closedIconClass4"},
"type5": null
}
The keys in the associative map take the form of the string type names while the values
may either be simple strings indicating the icon class or an object representing different
a "leaf" icon class and a "branch" icon class where the choice of which depends on whether
or not the item has children. Finally, the value may be null to indicate that no icon
should be used for that type.
idxBaseClass
Override the base class.
itemLabelKeyPrefix
Prefix to use for looking up labels for items in the specified resources.
If this is not set then the value is obtained from idx.resources using the
key "itemLabelKeyPrefix".
itemLabelKeySuffix
Suffix to use for looking up labels for items in the specified resources.
If this is not set then the value is obtained from idx.resource using the
key "badgeLabelKeySuffix".
lookupBadgeLabels
Set this to true to use the non-numeric badge labels as the basis for
"label" keys for looking up the labels to display in the tree items
from resources. Set this to false to take all labels literally without
attempting a lookup.
lookupItemLabels
Set this to true to use the item labels as the basis for "label" keys
for looking up the labels to display in the tree items from resources.
Set this to false to take all labels literally without attempting a
resource lookup.
resources
The resources for this instance.
showBadges
Indicates whether or not to show badges.
showIcons
Indicates whether or not to show icons adjacent to items.
showRoot
Indicate that the root of the tree should not be shown since our
navigation tree will have multiple roots.
templateString
Sets the template string used by the navigation tree.
Method Detail
buildRendering()
Override buildRendering() to update the CSS classes in the DOM.
getBadgeIconClass(item, opened)
Provides the badge icon class to use (if any).
- Parameters:
- item
- opened
getBadgeLabel(item)
Obtains the badge label to use for the item.
- Parameters:
- item
getIconClass(item, opened)
Overridden to leverage the "iconMap" attribute and the item type classifications.
- Parameters:
- item
- opened
getLabel(item)
Override to try to use the label prefix/suffix.
- Parameters:
- item
normalizeItem(item)
Pass-through method to the underlying NavTreeModel to request that it
normalize the item for direct use.
- Parameters:
- item
- The item to be normalized.
onClick(item, node, evt)
Override to trigger calling the "onSelectionChanged" function when a new node is selected.
- Parameters:
- item
- node
- evt
onSelectionChanged(items, nodes, tree, evt)
Called when the selection changes with an array of items that is paired
with an array of nodes and a reference to the tree itself. Typically
the arrays have a single item in them for the NavTree.
- Parameters:
- items
- nodes
- tree
- evt
postCreate()
Override to modify the "dndParams" to force "singular" selection behavior.
postMixInProperties()
Overrides dijit._Widget.postMixInProperties() to ensure
that the dijit._Widget.attr() function is called for each
property that was set.
- See:
- dijit._Widget.postMixInProperties