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: int Default Value: 0


showLoadingIndicator

Type: boolean Default Value: true


visible

Type: boolean Default Value: true


Events

onDrop

Called when a node is dropped as a result of a drag-n-drop

Parameters:

sourceNodePkPath string[] targetNodePkPath string[] indexInParent int event JSEvent


onReady

Parameters:

event JSEvent


API

addRoots

Add foundset to the list of foundsets used to create the tree's root nodes.

@example

myElement.addRoots(foundset);

@param foundSet

Parameters:

root foundsetref


createRelationInfo

Create relation info object used to set multiple child relations for a tree node

@param label @param nRelationName @return {relationInfo}

Parameters:

label string nRelationName string

Returns: relationInfo


getCheckBoxValues

Parameters:

datasource string

Returns: string[]


getSelectionPath

Returns path of the selected node.

@example

var selection = myElement.getSelectionPath()

@return {Array}

Returns: object[]


isNodeExpanded

Returns expand state of a node.

@example

var expanded = myElement.isNodeExpanded([22])

@param pkarray array of each level id @return {boolean}

Parameters:

pk object[]

Returns: boolean


refresh

Refresh the tree display.

@example

myElement.refresh()

removeAllRoots

Clears all foundset roots of the tree.

@example

myElement.removeAllRoots();

setCallBackInfo

Set callback info for a datasource foundset display.

@example

myElement.setCallBackInfo(databaseManager.getDataSource('example_data', 'categories'),'myfunction','arg');

@param datasource @param callbackfunction callback function name @param param

Parameters:

datasource string callbackfunction function param string


setCheckBoxAutoselectsChildren

Set the nodes whose checkbox will automatically autoselect children.

@example

myElement.setCheckBoxAutoselectsChildren(databaseManager.getDataSource('example_data', 'categories'),false);

@param datasource @param autoselect

Parameters:

datasource string autoselect boolean


setCheckBoxValueDataprovider

Set dataprovider for the checkbox displayed for a datasource foundset.

@example

myElement.setCheckBoxValueDataprovider(databaseManager.getDataSource('example_data', 'categories'),'enabled');

@param datasource @param checkboxvaluedataprovider dataprovider of the displayed checkbox

Parameters:

datasource string checkboxvaluedataprovider string


setChildSortDataprovider

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

myElement.setChildSortDataprovider(databaseManager.getDataSource('example_data', 'companies'),'company_sort');

@param datasource @param childsortdataprovider dataprovider of the sort text

Parameters:

datasource string childsortdataprovider string


setExpandNode

Sets expand state of a node.

@example

myElement.setExpandNode([22],true)

@param pkarray array of each level id @param state expand state

Parameters:

pk object[] state boolean


setHasCheckBoxDataprovider

Set relation for displaying a datasource foundset.

@example

myElement.setNRelationName(databaseManager.getDataSource('example_data', 'categories'),'companies_to_categories');

@param datasource @param nrelationname relation name

Parameters:

datasource string hascheckboxdataprovider string


setHasCheckBoxValue

Set the nodes that should have checkbox for a datasource when no hascheckboxdataprovider is used

@example

myElement.setHasCheckBoxValue(databaseManager.getDataSource('example_data', 'categories'),["1", "3", "5"]);

@param datasource @param hasCheckboxValue array of pks that should have checkbox

Parameters:

datasource string pks string[]


setImageURLDataprovider

Set dataprovider for the image displayed in tree node for a datasource foundset.

@example

myElement.setImageURLDataprovider(databaseManager.getDataSource('example_data', 'categories'),'mymedia');

@param datasource @param imageurldataprovider dataprovider of the node image

Parameters:

datasource string imageurldataprovider string


setInitialCheckBoxValues

Set intial checked checkboxes for a datasource foundset when no checkboxdataprovider is used

@example

myElement.setInitialCheckBoxValues(databaseManager.getDataSource('example_data', 'categories'),["1", "3", "5"]);

@param datasource @param checkboxValues array of pks that should have the checkbox checked

Parameters:

datasource string pks string[]


setMethodToCallOnCheckBoxChange

Set callback info for a datasource foundset checkbox display.

@example

myElement.setMethodToCallOnCheckBoxChange(databaseManager.getDataSource('example_data', 'categories'),'myfunction','arg');

@param datasource @param callbackfunction callback function name @param param

Parameters:

datasource string callbackfunction function param string


setMethodToCallOnDoubleClick

Set callback info for a datasource foundset doubleclick event.

@example

myElement.setMethodToCallOnDoubleClick(databaseManager.getDataSource('example_data', 'categories'),'myfunction','arg');

@param datasource @param callbackfunction callback function name @param param

Parameters:

datasource string callbackfunction function param string


setMethodToCallOnRightClick

Set callback info for a datasource foundset right click event.

@example

myElement.setMethodToCallOnRightClick(databaseManager.getDataSource('example_data', 'categories'),'myfunction','arg');

@param datasource @param callbackfunction callback function name @param param

Parameters:

datasource string callbackfunction function param string


setNRelationInfos

Set n-relation infos (array of RelationInfo objects created using tree.createRelationInfo() for having multiple child relations for one node)

@param datasource @param relationInfos

Parameters:

datasource string relationInfos relationInfo[]


setNRelationName

Set relation for displaying a datasource foundset.

@example

myElement.setNRelationName(databaseManager.getDataSource('example_data', 'categories'),'companies_to_categories');

@param datasource @param nrelationname relation name

Parameters:

datasource string nrelationname string


setNodeLevelVisible

Sets expanded state for a tree level. Expanding the tree may cause performance issues.

@example

myElement.setNodeLevelVisible(2,true)

@param level level in tree @param state expanded state

Parameters:

level int visible boolean


setSelectionPath

Sets selection node of the tree.

@example

myElement.setSelectionPath([22])

@param pkarray array of each level id

Parameters:

pk object[]


setTextDataprovider

Set dataprovider for the text displayed from a datasource foundset.

@example

myElement.setTextDataprovider(databaseManager.getDataSource('example_data', 'categories'),'categoryname');

@param datasource @param textdataprovider dataprovider of the displayed text

Parameters:

datasource string textdataprovider string


setToolTipTextDataprovider

Set dataprovider for the tooltip text displayed for a datasource foundset.

@example

myElement.setToolTipTextDataprovider(databaseManager.getDataSource('example_data', 'categories'),'tooltip');

@param datasource @param tooltiptextdataprovider dataprovider of the displayed checkbox

Parameters:

datasource string tooltiptextdataprovider string


updateCheckBoxValues

Parameters:

datasource string pks string[] state boolean


Types

binding

callback

levelVisibilityType

relationInfo

Last updated