B4J Tutorial TreeTableView

Erel

Administrator
Staff member
Licensed User
TreeTableView is a new control added in B4J v5.80.



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:


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

Attachments

ShaneG30

Well-Known Member
Licensed 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
 

rraswisak

Active Member
Licensed User
Hi,

I found at example-2 has bug when we double-click the column divider to auto width by column text, the panel was missing !

This has been reported in this thread

Thank you
 
Top