htable = treeTable (pnContainer, headers, data, 'PropName',PropValue, ...)
pnContainer - optional handle to container uipanel or figure (default: gcf)
headers - optional cell array of column header strings
data - optional numeric or cell array of data values
'PropName',PropValue - optional list of property-value pairs: Container, Headers, Data, IconFilenames, ColumnTypes, ColumnEditable, Groupable, InteractiveGrouping
(see internal help section for details)
htable - handle to Java tree-table object
* Table is fully sortable (multiple columns via ctrl-click on header)
* Table can be flat or hierarchical (grouping)
* Interactive grouping (like in Outlook)
* Editable drop-down (selector) option
* Table columns are automatically resized to fit the available width
* Table columns are rearrangeable by dragging the headers right/left
* Table columns can be resized by dragging their divider gridlines (not just the header)
* User-defined icons for leaf rows and grouping rows (expanded/collapsed)
* Sample data update and row selection callbacks included; user can attach custom callbacks
This code heavily relies on undocumented and unsupported Matlab functionality. It works on Matlab 7+, but use at your own risk!
Bugs and suggestions:
Please send to Yair Altman (altmany at gmail dot com)
Technical details of the implementation can be found at http://UndocumentedMatlab.com/blog/treeTable
Yair Altman (2019). treeTable - create a sortable table control with collapsible row groups (https://www.mathworks.com/matlabcentral/fileexchange/42946-treetable-create-a-sortable-table-control-with-collapsible-row-groups), MATLAB Central File Exchange. Retrieved .
I've been fighting with data output. Is there a simple way to recover all (moddified) data in the same cell format as originally loaded?
Dear Yair, is there a way to get access to the data which is saved in the model?
I want to update the data in this table often and it would be easier having an table.Data function like in uitable.
Is it possible for the tree table to be able to allow users to add data rows for any label?
@Ramiro - this would probably require a dedicated Java cell-renderer for the table column.
hi Yair, is it possible to customize each node of treetable? let's say, have different icons for specific nodes?
Is it possible to have different data types under one column of treetable?
Dear Yair, there has been a discussion about wanted features for uitree and uitable in the forum: http://www.mathworks.com/matlabcentral/answers/24369-wanted-features-for-uitable-and-uitree
Your treeTable solves many of the problems mentioned there. I cannot imagine, why TMW hesitates to implement such powerful GUI tools by their own.
Wow! That's amazing. Very useful. Great job!
This is great! One thing I noticed: When I enter "-0" in the Numeric column, it is not changed to "0". Is this intended behaviour? Also, when I move the first column, the folder symbols and labels are separated.
Add this to the It Simply Works(TM) suite of tools.
Forgot a couple of important Java files in the previous uploads, sorry about that...
Added InteractiveGrouping option to enable interactive column grouping as in Microsoft Outlook
Inspired by: Java-based data table