django-nested-admin icon indicating copy to clipboard operation
django-nested-admin copied to clipboard

Nested items in Django admin do not always expand on click

Open riwart opened this issue 7 years ago • 2 comments

Hi

I have to re-open this ticket, as my actual problem is still unsolved. I have updated my test project riwart/django-nested-admin-test to django-nested-admin 3.2.2, but the issue remains. I have also checked if this issue might be Browser-dependent (Chrome, Firefox), but it isn't. All I see are some subtile differences in the css classes that are assigned to the divs #child1_set-0-child2_set-0 vs. #child1_set-1-child2_set-0: html body.test_app-parent.grp-change-form div#container.grp-container article#grp-content div#grp-content-container form#parent_form div div#child1_set-group.inline-group.group.grp-group.djn-group.grp-stacked.djn-stacked.djn-group-root div.djn-items.grp-items.ui-sortable div#child1_set-0.djn-item.grp-module.djn-module.djn-inline-form.grp-collapse.inline-related.dynamic-form.grp-dynamic-form.djn-dynamic-form-test_app-child1.grp-open div#child1_set-0-child2_set-group.inline-group.group.grp-group.djn-group.grp-stacked.djn-stacked.djn-group-nested div.djn-items.grp-items.ui-sortable div#child1_set-0-child2_set-0.djn-item.grp-module.djn-module.djn-inline-form.grp-collapse.inline-related.dynamic-form.grp-dynamic-form.djn-dynamic-form-test_app-child2.grp-closed ... which is assigned to the div that is collapsible. vs. html body.test_app-parent.grp-change-form div#container.grp-container article#grp-content div#grp-content-container form#parent_form div div#child1_set-group.inline-group.group.grp-group.djn-group.grp-stacked.djn-stacked.djn-group-root div.djn-items.grp-items.ui-sortable div#child1_set-1.grp-module.djn-module.djn-inline-form.grp-collapse.inline-related.djn-item.dynamic-form.grp-dynamic-form.djn-dynamic-form-test_app-child1.closed.open.grp-open div#child1_set-1-child2_set-group.inline-group.group.grp-group.djn-group.grp-stacked.djn-stacked.djn-group-nested div.djn-items.grp-items.ui-sortable div#child1_set-1-child2_set-0.djn-item.grp-module.djn-module.djn-inline-form.grp-collapse.grp-closed.inline-related.dynamic-form.grp-dynamic-form.djn-dynamic-form-test_app-child2 ... which is assigned to the div that does NOT collapse when I click on it.

Hope any of that information helps! Richard

riwart avatar Apr 11 '19 05:04 riwart

In your class list there I see you have inlines that have class="grp-collapse grp-open closed open". How are you defining your classes and inline_classes attributes on your NestedInlineModelAdmin classes? Are you using classes=("grp-collapse", "grp-open") or inline_classes=("grp-collapse", "grp-open"), or do you have something else?

fdintino avatar Apr 11 '19 12:04 fdintino

Hi, I am working on a project and got stuck with the same issue. I have "django-nested-admin-3.2.4" installed.

  1. The "Show/Hide" toggle is not working in the 2nd nested child when another 1st child is added in a saved Model Object.

  2. Also, the "Show/Hide" toggle for 2nd child is not working when creating a new 1st child, when creating an entirely new Model Object.

My classes attribute is defined as this - classes = ["collapse"]

ParfectShot avatar Dec 06 '19 10:12 ParfectShot