App Designer: uitable to behave like uitree with checkboxes
5 views (last 30 days)
Show older comments
Is there a native way in App Designer to make the uitable (or equivalent) look and feel like a uitree with checkboxes, so it can expand and collapse sections of the uitable (see image below)? Made up example: if one of the top nodes is fruit, I want to expand the node to show various fruits (apple, banana, etc) along with specific associated information in the table like quantity, sales price, quantity on order, etc. Then have the checkboxes to select all or none in the top node and the checkboxes for the individual fruit rows. The other top nodes would follow.
I would prefer not to use a 3rd party tool to work with matlab as it may complicate the compiler's abilities down the road if I need it. thanks.

0 Comments
Answers (1)
Rahul
on 8 May 2025
Edited: Rahul
on 8 May 2025
While this functionality is not natively present in MATLAB currently, you can consider using 'uicheckboxes' inside a 'uitable' component along with setting a 'cellEdit' callback on the 'uitable'. Inside the 'cellEdit' callback you can add code for adding subrows below the row in which the checkbox is selected. You can remove the sub row when the checkbox gets unselected.
While this would not look equivalent to a 'uitree' component which would have a heirarchy to rows, but it would give the desired functionality of obtaining subrows.
I have attached an mlapp file for reference.
'CellEditCallback': https://www.mathworks.com/help/matlab/ref/uitable.html#br5rl9k_sep_bvboy7l-1-CellEditCallback
Thanks.
0 Comments
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!