App Designer: uitable to behave like uitree with checkboxes

2 visualizaciones (últimos 30 días)
NS
NS el 5 de Mayo de 2022
Editada: Rahul el 8 de Mayo de 2025
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.

Respuestas (1)

Rahul
Rahul el 8 de Mayo de 2025
Editada: Rahul el 8 de Mayo de 2025
Hi @NS,
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.
Thanks.

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by