App Designer: uitable to behave like uitree with checkboxes
조회 수: 3 (최근 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!