Having trouble with nested-lists and tutorial 21 #126
-
Consider a hierarchy tree built of lists and sublists that I will not know until runtime. I want to start out collapsed and choose which subtrees to expand, then click on an actual final item to get an alert box with info about the item. In tutorials 19 and 20, it is very clear and easy to create a subtree. In tutorial 19 You can just drop a
in the middle and now the previous item becomes the top of a new subtree.
It starts out nicely collapsed and I can pick and choose what to expand and what to collapse. It is clear what is the beginning of another tree and what is a final leaf of a branch. I am struggling to do the same in tutorial 21. Any pointers on how to do that?
Ignoring the fact that I do not actually know the number of items and subtrees until runtime, tutorial 21 with the above tree opens fully expanded. If I then click on the bottom subtree, everything collapses. Clicking on the top of tree at that point returns Item 1 and Item 2 and Middle of tree. If I click on Middle of tree trying to get its sublist, everything collapses back to Top of tree Clicking on Top of Tree again now expands down to Lower Part of Tree (without sublist) Clicking on Lower Part of Tree collapses everything again; this time clicking on Top of tree returns the first two items and Middle of Tree. Clicking anywhere collapses everything again, but this time clicking on Top of tree expands the entire tree. Basically I am misunderstanding how the hide/not hide is passed up and down. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Since the example was emphasizing how to write a plug-in I never tested it with additional drop downs. I have corrected the example. The correction is I used on-mouse-down instead of on-click and I set cancel-event to true. This prevents "event bubble" so that the same even after processing bubbles up to the outer containing element. I also added more to the example so you can see how this works and also how to control drops at run time. Sorry for the delay in answering. |
Beta Was this translation helpful? Give feedback.
Since the example was emphasizing how to write a plug-in I never tested it with additional drop downs. I have corrected the example. The correction is I used on-mouse-down instead of on-click and I set cancel-event to true. This prevents "event bubble" so that the same even after processing bubbles up to the outer containing element.
I also added more to the example so you can see how this works and also how to control drops at run time.
Sorry for the delay in answering.