DBTreeview
Servoy extra components contains two tree components. The difference between the two is the model, the dbtreeview is based on foundset(s) while treeview is based on dataset.
DbTreeview shows multiple tree levels based on relation. From top foundset (datasource), one can show related nodes specified by a relation. Note that each relation is a database query , so for performance should not abuse the tree expand (from javascript). The tree works lazy and initializes data as requested.
Usual tree features are included, show a node checkbox, node image, tooltip, click callback, expand node... More information about model/api can be seen in Servoy Developer.
This component is a porting to NG of Servoy's DBTreeView bean, you can find more details about the migration here: https://wiki.servoy.com/display/DOCS/Upgrading+to+Servoy+8.x.x#UpgradingtoServoy8.x.x-DBTreeView
Here is a sample code of the tree initialization:
//set the relation to discover other nodes (when clicked open)
elements.dbtreeview.setNRelationName(controller.getDataSource(), 'book_nodes_to_book_nodes_parent_childs');
//set the name of dataprovider to use for text display on a node
elements.dbtreeview.setTextDataprovider(controller.getDataSource(), 'label_text');
//set the method to call and dataprovider value to pass when node clicked
elements.dbtreeview.setCallBackInfo(controller.getDataSource(), globals.node_selected,'node_id');
//search the root node(s)
controller.find();
parent_id = 0;
controller.search();
//set the root node(s) and set the name of dataprovider to use for text display on a node
elements.dbtreeview.addRoots(foundset);
var pathAr = new Array(1,2,3);
elements.dbtreeview.setSelectionPath(pathAr);
Table of contents
DBTreeView properties
DBTreeView properties can be found here
The component has only one public property, component should be handled via API.
DBTreeView Events
DBTreeView events can be found here
DBTreeView API
DBTreeView API methods can be found here
DBTreeView Types
DBTreeView types can be found here
Last updated
Was this helpful?