Answer the question
In order to leave comments, you need to log in
When using the dropdown menu to display the django-mptt tree, nesting is not fully displayed. How to make the tree displayed completely?
When using normal recursion to display the tree, everything is displayed fine
. But I need a drop-down list, and in this case, not full nesting is displayed, but only up to the second level. I don't understand why, please help.
Here is the code from the template:
{% load mptt_tags %}
{% recursetree rubrics %}
<ul class="nav">
<li class="nav-item dropright">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false"> {{ node.name }}</a>
{% if not node.is_leaf_node %}
<ul class="dropdown-menu">
<li><a class="dropdown-item">{{ children }}</a></li>
</ul>
{% endif %}
</ul>
{% endrecursetree %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question