I'm trying to implement a simple project with a Google map and a component that has a tree in it. I've set up the tree like how it is shown in the example on the Montage website. My tree model has about 2,000 objects in it. Each object is a subclass of a Montage object.
It works but it takes a long time to load and the browser starts using a lot of memory. Is there a way to optimize the tree? Or should I not be using the Montage object for the parent of my model objects?
Thanks in advance,
Tried making my own recursive component and could not get that to work either
I have a conditional that wraps the children. When the checkbox is checked it shows the children. For some reason the bindings within the conditional do not get evaluated after the checkbox gets checked. It just returns the html? If I make the checkbox checked by default it prints out the whole tree.
Am I missing some magic here?
I think I got the recursive function to work. Instead of using a condition I used the substitution component and just bound the first level below it to the checkbox being true. Now it parses the content in the template in that section.
I suppose I need to read how the substitution component works now.
We will very likely need to look into the performance of the TreeController with upward of 1000 values. Depending on the breadth and depth of the tree, it is possible that this is very expensive with the current technique of recursively projecting the array of open nodes onto the parent node.
I’m glad the substitution did the trick for you. In recent months, we made changes to ensure that substitution and repetition interact well when nested recursively. @aadsm and I will need to discuss whether the condition needs a similar treatment. I expect that there is a problem with the scope of template expansion for the Condition.
@romancortes (Javier) has also created tree components using the recursive template strategy and might have some insight.
Thank you for the explanation. Of course, I would be very interested to receive advice from @romancortes. In a related question, what is the difference between the slot and the substitution components? And do you plan on making a component whose prototype can get evaluated at runtime? Kind of like the WOSwitchComponent?