B4J Tutorial TreeTableView

TreeTableView is a new control added in B4J v5.80.

SS-2017-07-13_15.52.52.png


TreeTableView is very similar to TreeView where each item has multiple values instead of a single value.

B4X:
Dim tti As TreeTableItem
tti.Initialize("tt", Array("Column 0 value", "Column 1 value", "Column 2 value"))
TreeTableView1.Root.Children.Add(tti)

The columns are set with the designer or by calling TreeTableView.SetColumns.

Note that unlike TreeView which only works with string items, TreeTableView items can be strings, numbers or nodes.

The second example shows how to use a layout file to create custom items:
SS-2017-07-13_16.15.13.png


Note that the rows heights are explicitly set in this case.
The second example also shows how to iterate over all the items.
 

Attachments

  • TreeTableViewExample.zip
    2.6 KB · Views: 1,490
  • TreeTableView2ndExample.zip
    4.1 KB · Views: 1,603

LWGShane

Well-Known Member
Licensed User
Longtime User
This looks to be an awesome control. It also looks way easier than the normal TableView.

However, there's a problem with RowHeight, this is the output from the example project ("TreeTableView2ndExample"):
B4J Version: 5.80 BETA #2
Parsing code. (0.00s)
Compiling code. (0.02s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
B4J line: 22
TreeTableView1.RowHeight = 50
javac 1.8.0_131
src\b4j\example\main.java:158: error: cannot find symbol
_treetableview1.setRowHeight(50);
^
symbol: method setRowHeight(int)
location: variable _treetableview1 of type TreeTableViewWrapper
 
Top