App Designer: uitable to behave like uitree with checkboxes
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Rahul
2025 年 5 月 8 日
編集済み: Rahul
2025 年 5 月 8 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!