SMART datagrid v.1 > Concepts

Back  Forward

Concepts.Tree Overview

SMART datagrid Tree View is a UI component which displays and handles data rows who have hierarchical relationships between parent and child logically. Each row consists of the same field set, and from the stance of component, it will not differentiate values depending on hierarchy. In other words, except that data rows can have hierarchical relationships, it is the same as Grid View. In fact, Tree View and Grid View inherits GridBase equally. 

1. Tree Data Set

Differently from Grid Data Set being managed by two-dimensional array, TreeDataSet creates and manages each row by TreeDataRow object. All rows can have Child Rows, and they can add or delete child rows through TreeDataSet.addRow and TreeDataSet.deleteRow methods. 

Code -1
    var dataset = DataLudi.createTreeDataSet();
    // Or
    var dataset = new DataLudi.TreeDataSet();
    // Organize Field Set.
    dataset.setFields(fields);
2. Tree View

Each Row of TreeView is connected to data row of tree data set being connected to tree view. And, like Grid View, if exclude filtering and sorting, it basically gets and displays the hierarchy of data set as it is. 

Code -2
    var treeview = DataLudi.createTreeView('treeview');
    // Organize Column Layout.
    treeview.setColumns(columns);
    // Connect to Data Set.
    treeview.setDataSource(dataset);
See Also
TreeDataSet
TreeDataRow
TreeView
TreeRow
GridDataSet
GridView
Examples
Hello Tree
Tree Data Set
Load Tree Data