Treeview
(part of package 'Servoy Extra Components') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent
This is a reference page; many components have detailed usage guides here.
Properties
jsDataSet
Type: dataset
styleClass
Type: styleclass
Events
onNodeClicked(nodeId,event,columnName)
Parameters:
onNodeCollapsed(nodeId)
Parameters:
{object} nodeId
onNodeDoubleClicked(nodeId,event)
Parameters:
onNodeExpanded(nodeId)
Parameters:
{object} nodeId
onNodeRightClicked(nodeId,event)
Parameters:
onNodeSelected(nodeId)
Parameters:
{object} nodeId
onReady(event)
Parameters:
{JSEvent} event
API
collapseAll()
Collapse all nodes
Example:
Returns: boolean
collapseNode(nodeId)
Collaps a node by id.
Example:
Parameters:
{object} nodeId ** nodeId node id
expandAll()
Expand all nodes
Example:
Returns: boolean
expandNode(nodeId)
Expand a node by id.
Example:
Parameters:
{object} nodeId ** nodeId node id
filterBranches(text,options)
Dimm or hide unmatched branches. Matching nodes are displayed together with all descendants.
Parameters:
filterNodes(text,options)
Dimm or hide unmatched nodes. NOTE: This function might not work as expected if the node titles contain HTML markup.
Example:
Parameters:
{string} text Filter nodes matching the given text
{object} [options] Filter options List of options: autoExpand**, type: {boolean}, default: false Temporarily expand matching node parents while filter is active. fuzzy**, type: {boolean}, default: false Match single characters in order, e.g. 'fb' will match 'FooBar'. hideExpanders**, type: {boolean}, default: false Hide hideExpanders expanders if all child nodes are hidden by filter. highlight**, type: {boolean}, default: false Highlight matches by wrapping inside tags. leavesOnly**, type: {boolean}, default: false Match end nodes only. mode**, type: {string: 'dimm' | 'hide'}, default: 'hide' Defines if unmatched nodes are grayed out or hidden. nodata**, type: {boolean|string|object|function}, default: true Display the string 'No data' if the filtered tree would be empty.
getChildNodes(nodeId)
Get child nodes ids of a parent node.
Example:
Parameters:
{object} nodeId ** nodeId node id
Returns: object
getNodeLevel(nodeId)
Get the tree level a node is situated.
Example:
Parameters:
{object} nodeId ** nodeId node id
Returns: int
getParentNode(nodeId)
Get child nodes ids of a parent node.
Example:
Parameters:
{object} nodeId ** nodeId node id
Returns: object
getRootNodes()
Get root nodes ids .
Example:
Returns: object
getSeletedNode()
Get selected node id.
Example:
Returns: object
isNodeExpanded(nodeId)
Returns expand state of a node.
Example:
Parameters:
{object} nodeId ** pk array of each level id
Returns: boolean
refresh(restoreExpandedNodes)
Refresh the tree display.
Example:
Parameters:
{boolean} restoreExpandedNodes
setColumnWidth(columnWidth)
Sets the column width
Example:
Parameters:
{int} columnWidth ColumnWidth column width
setDataSet(jsDataSet)
Sets the tree data
Example:
Parameters:
{dataset} jsDataSet ** jsDataSet the JSDataSet used for the tree model
setSelectedNode(nodeId)
Sets selected node by id.
Example:
Parameters:
{object} nodeId ** nodeId node id
Last updated