DBTreeview
(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
allowDrag
Can be used to enable dragging of nodes. Can either be a boolean value or a clientfunction that is executed in browser. Default value is false.
Type: Object
allowDrop
Can be used to enable dropping of nodes. Can either be a boolean value or a clientfunction that is executed in browser. Default value is false.
Type: Object
autoRefresh
If true, component listens to foundset changes and updates itself while visible.
Type: Boolean Default Value: true
enabled
Type: Boolean Default Value: true
responsiveHeight
Height of the treeview, set only in responsive forms.
Type: Number Default Value: 0
showLoadingIndicator
Type: Boolean Default Value: true
styleClass
Type: Styleclass
visible
Type: Boolean Default Value: true
Events
onDrop(sourceNodePkPath,targetNodePkPath,indexInParent,event)
Called when a node is dropped as a result of a drag-n-drop
Parameters:
{Array<string>} sourceNodePkPath
{Array<string>} targetNodePkPath
{Number} indexInParent
{JSEvent} event
onReady(event)
Parameters:
{JSEvent} event
API
addRoots(root)
Add foundset to the list of foundsets used to create the tree's root nodes.
Example:
Parameters:
{Foundsetref} root The foundset reference to be added as a root node in the tree structure.
createRelationInfo(label,nRelationName)
Create relation info object used to set multiple child relations for a tree node
Parameters:
Returns: CustomType<servoyextra-dbtreeview.relationInfo> An object containing the relation information for setting child relations in the tree structure.
getCheckBoxValues(datasource)
Returns array of pk of nodes that are checked for the datasource
Example:
Parameters:
{String} datasource The datasource identifier, representing the foundset for which the checked nodes' primary keys are retrieved.
Returns: Array<String> An array of primary keys of the nodes that are checked for the specified datasource.
getSelectionPath()
Returns the path of the currently selected node in the tree.
Example:
Returns: Array<Object> An array representing the path of the selected node in the tree.
isNodeExpanded(pk)
Returns expand state of a node.
Example:
Parameters:
{Array<object>} pk Array of each level id
Returns: Boolean True if the specified node is expanded, false if it is collapsed.
refresh()
Refresh the tree display.
Example:
removeAllRoots()
Clears all foundset roots of the tree.
Example:
setActionsCallBack(actions)
Set callback info for specific actions.
Example:
Parameters:
{Array<action>} actions An array of action objects, each defining a datasource, a callback function, its arguments, and the associated tree element for which the action should be triggered.
setCallBackInfo(datasource,callbackfunction,param)
Set callback info for a datasource foundset display.
Example:
Parameters:
setCheckBoxAutoselectsChildren(datasource,autoselect)
Set the nodes whose checkbox will automatically autoselect children.
Example:
Parameters:
setCheckBoxValueDataprovider(datasource,checkboxvaluedataprovider)
Set dataprovider for the checkbox displayed for a datasource foundset.
Example:
Parameters:
setChildSortDataprovider(datasource,childsortdataprovider)
Set the dataprovider name to retrieve column name and sort order for the child nodes. The provided data must be a string of form : column_name_used_for_sort sort_order(asc or desc)
Example:
Parameters:
setExpandNode(pk,state)
Sets expand state of a node.
Example:
Parameters:
{Array<object>} pk Array of each level
{Boolean} state Expand state
setHasCheckBoxDataprovider(datasource,hascheckboxdataprovider)
Set relation for displaying a datasource foundset.
Example:
Parameters:
setHasCheckBoxValue(datasource,pks)
Set the nodes that should have checkbox for a datasource when no hascheckboxdataprovider is used
Example:
Parameters:
{String} datasource The datasource identifier, representing the foundset for which the checkboxes should be applied.
{Array<string>} pks Array of primary keys that should have a checkbox associated with them.
setImageURLDataprovider(datasource,imageurldataprovider)
Set dataprovider for the image displayed in tree node for a datasource foundset.
Example:
Parameters:
setInitialCheckBoxValues(datasource,pks)
Set intial checked checkboxes for a datasource foundset when no checkboxdataprovider is used
Example:
Parameters:
{String} datasource The datasource identifier, representing the foundset where checkboxes are applied.
{Array<string>} pks Array of pks that should have the checkbox checked
setMethodToCallOnCheckBoxChange(datasource,callbackfunction,param)
Set callback info for a datasource foundset checkbox display.
Example:
Parameters:
setMethodToCallOnDoubleClick(datasource,callbackfunction,param)
Set callback info for a datasource foundset doubleclick event.
Example:
Parameters:
{String} datasource The datasource identifier, representing the foundset for which the double-click callback is being set.
{Function} callbackfunction The name of the function to be invoked when a double-click event occurs on a node.
{String} param A parameter to be passed to the callback function during invocation.
setMethodToCallOnRightClick(datasource,callbackfunction,param)
Set callback info for a datasource foundset right click event.
Example:
Parameters:
setNRelationInfos(datasource,relationInfos)
Set n-relation infos (array of RelationInfo objects created using tree.createRelationInfo() for having multiple child relations for one node)
Parameters:
{String} datasource The datasource identifier, representing the foundset for which the relations are being set.
{Array<relationInfo>} relationInfos An array of objects, defining multiple child relations for a single node.
setNRelationName(datasource,nrelationname)
Set relation for displaying a datasource foundset.
Example:
Parameters:
setNodeLevelVisible(level,visible)
Sets expanded state for a tree level. Expanding the tree may cause performance issues.
Example:
Parameters:
setSelectionPath(pk)
Sets selection node of the tree.
Example:
Parameters:
{Array<object>} pk Array of each level id
setTextDataprovider(datasource,textdataprovider)
Set dataprovider for the text displayed from a datasource foundset.
Example:
Parameters:
setToolTipTextDataprovider(datasource,tooltiptextdataprovider)
Set dataprovider for the tooltip text displayed for a datasource foundset.
Example:
Parameters:
updateCheckBoxValues(datasource,pks,state)
Update checkbox state for nodes
Example:
Parameters:
{String} datasource The datasource identifier, representing the foundset for which the checkbox states are being updated.
{Array<string>} pks Array of primary keys of the nodes for which the checkbox state should be updated.
{Boolean} state True to check the checkbox, false to uncheck it.
Types
action
scripting type: CustomType<servoyextra-dbtreeview.action>
binding
scripting type: CustomType<servoyextra-dbtreeview.binding>
callbackinfo
Type: callback
checkboxvaluedataprovider
Type: string
childsortdataprovider
Type: string
datasource
Type: string
hasCheckboxValue
Type: object[]
hascheckboxdataprovider
Type: string
imageurldataprovider
Type: string
initialCheckboxValues
Type: object[]
methodToCallOnCheckBoxChange
Type: callback
methodToCallOnDoubleClick
Type: callback
methodToCallOnRightClick
Type: callback
nRelationInfos
Type: relationInfo[]
nrelationname
Type: string
textdataprovider
Type: string
tooltiptextdataprovider
Type: string
callback
scripting type: CustomType<servoyextra-dbtreeview.callback>
levelVisibilityType
scripting type: CustomType<servoyextra-dbtreeview.levelVisibilityType>
relationInfo
scripting type: CustomType<servoyextra-dbtreeview.relationInfo>
Last updated
Was this helpful?