Module: alfresco/navigation/PathTree

alfresco/navigation/PathTree

This extends the standard tree to handle path filtering updates to ensure that the tree expands all nodes on the path.
Author:
  • Dave Draper
License:
Source:

Members

useHash :boolean

This determines whether or not to subcribe to the hash change topic or the [path change topic]{@link module:alfresco/documentlibrary/_AlfDocumentListTopicMixin#pathChangeTopic}. Although the path tree doesn't make changes to the browser URL hash, it can be driven from them to that it expands tree nodes to reflect the path attribute set as a hash parameter.
Type:
  • boolean
Default Value:
  • true
Source:

Methods

expandPathElement(node, pathElements)

Expands the child of the target node that matches the next element on the supplied path. It then recursively calls it self until all tree nodes representing the current path have been expanded.
Parameters:
Name Type Description
node object The tree node to check the children of
pathElements string[] The array of remaining path elements to process (the first element will be searched for)
Source:

onContentCreated(payload)

This function attempts to refresh the node that content has just been created in.
Parameters:
Name Type Description
payload object A payload containing the nodeRef of the created object and the nodeRef of the node it was created as a child of.
Since:
  • 1.0.48
Source:

onContentDeleted(payload)

This function attempts to refresh the node that content has just been deleted from.
Parameters:
Name Type Description
payload object A payload containing an array of nodeRefs for the deleted nodes.
Since:
  • 1.0.48
Source:

onFilterChange(payload)

When the filter is updated to represent a path then this callback function will ensure that the tree expands all of the relevant nodes to display that path.
Parameters:
Name Type Description
payload object
Source:

postMixInProperties()

Extends the inherited function to subscribe to the hashChangeTopic topic passing the [onFilterChange function]{@link module:alfresco/navigation/PathTree#onFilterChange} as the callback handler.
Source:
Listens to Events:

refreshTreeNode(treeNode)

Handles the refreshing of a particular node in the tree. In order to perform the refresh it is necessary to remove any cached data from the model relating to the children of the node and to make sure any previously loaded data is removed from the node itself. The tree node is collapsed and expanded to render the latest data. This function is called from the onContentCreated and [onContentDeleted]{@link module:alfresco/navigaion/PathTree#onContentDeleted} functions to refresh the tree when folders are created and deleted.
Parameters:
Name Type Description
treeNode object The node widget to refresh in the tree.
Since:
  • 1.0.48
Source: