to Delete item at runtime
-
06-07-2019 - |
Question
I have created some shapes dynamically at run time by mouse drag, Now i want to delete any selected item the white board.How can i achieve that. Currently i am able to delete the last drawn item through "removeChild()" method, but not the previous items. Please help.
Thanks in advance.
Solution
Luckily i got my answer very soon. To delete multiple items at run time i've assign the ids to them dyanimically and the done the following:
parentComponent.removeChild(parent.getChildByName("itemName"));
before trying this i was doing
parentComponent.removeChild(item);
Cheers !!!
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow