File Exchange

image thumbnail

treeTable - create a sortable table control with collapsible row groups

version 1.3 (66.8 KB) by

Create a sortable Java-based tree-table GUI control having collapsible/expandable data row groups

14 Downloads

Updated

View License

Syntax:
htable = treeTable (pnContainer, headers, data, 'PropName',PropValue, ...)

Input parameters:
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)

Output parameters:
htable - handle to Java tree-table object

Important features:
* 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

Warning:
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

Comments and Ratings (9)

Juan Garcia

Is it possible for the tree table to be able to allow users to add data rows for any label?

Yair Altman

Yair Altman (view profile)

@Ramiro - this would probably require a dedicated Java cell-renderer for the table column.

Ramiro Massol

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?
best
ramiro

Kim

Kim (view profile)

Amazing

Jan Simon

Jan Simon (view profile)

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.

Assaf

Assaf (view profile)

Wow! That's amazing. Very useful. Great job!

852053843

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.

Sven

Sven (view profile)

Add this to the It Simply Works(TM) suite of tools.

Updates

1.3

Forgot a couple of important Java files in the previous uploads, sorry about that...

1.2

Added InteractiveGrouping option to enable interactive column grouping as in Microsoft Outlook

MATLAB Release
MATLAB 7.11 (R2010b)
Acknowledgements

Inspired by: Java-based data table

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video