So I have expansion / falling trees which I keep track of session data
I want to be able to render the tree in Zago based on session data.
I am saving the state like this:
In my template for rendering, I am looping through items and wanting for each item Set the visibility of the object for example: - %} for items in {%} and
is the place where I am confused
Can I specify:
request .session.treedata. (Item.id)
or
request.session.treedata. (Forloop.counter)
Do I have to pre-process the item and state in a new reference variable?
Thanks
Assume that items
is a model, and item_id
is item.id
, you should be able to:
{item items %%} in & lt; Div {% if request.session.treed.titem.id%} style = "display: none" {% endif%} & gt; The contents of the subtree & lt; / Div & gt; {% Endfor%}
You can read about how the dynamo template is seeing variables here:
Comments
Post a Comment