Azzera filtri
Azzera filtri

Add and delete Tree nodes with context menu in app designer

71 visualizzazioni (ultimi 30 giorni)
I am making an app using app designer.
There is a uitree, and I was able to create a child node of that uitree through the add button like below.
function buttonPushed(app,event)
app.TreeNode = uitreenode(app.Scenario1Node);
But after creating multiple nodes, I can't figure out how to remove the selected node.
What should I do?
My goal is that when creating a node, the contextmenu of the node is also created, and the contextmenu has a function to delete the selected node.
please help me! Thank you.

Risposta accettata

Alberto Cuadra Lara
Alberto Cuadra Lara il 15 Giu 2022
Hi Jae-Hee,
You can delete the node directly as follows
% Remove node of UITree
% If you want to remove only its children use
  2 Commenti
Jae-Hee Park
Jae-Hee Park il 15 Giu 2022
when I want to delete just one Children Node, how can I select that node and delete?
Alberto Cuadra Lara
Alberto Cuadra Lara il 15 Giu 2022
Modificato: Alberto Cuadra Lara il 15 Giu 2022
To obtain the selected nodes use the SelectedNodes property of the object Tree
To delete a particular position of the TreeNode array use

Accedi per commentare.

Più risposte (0)


Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by