Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#13300 closed (worksforme)

Collapsable fieldsets broken in StackedInline

Reported by: Evandro Myller Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: collapse, admin, javascript
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When a StackedInline item's extra = 0, the Show/Hide toggle link doesn't work in newly added entries.

I guess it happens due to the fact that the current js adds the click event listener to the existent links only (it works if there are entries previously saved, loaded with the changeform page). It should watch for clicks "lively" (this is what jQuery's .live does , I think).

Change History (3)

comment:1 by Russell Keith-Magee, 15 years ago

Resolution: worksforme
Status: newclosed

I think this may have been fixed by r12937.

Here's my test case (using a Book model that is inline to something else):

class BookInline(admin.StackedInline):
    model = Book
    extra = 0
    fieldsets = (
        ('other', {
            'fields': ('name','pages'),
            'classes': ('collapse',),
        }),
    )

I can't see any unusual behaviour with r12937; but if I revert to r12936, nothing added as an extra after the page render works properly.

If I've misunderstood your report, please reopen, providing a specific example of a StackedInline definition that doesn't work as expected.

comment:2 by Evandro Myller, 15 years ago

shameonme, it worked for me now too. guess it was a caching problem (Chrome weirdness?).

comment:3 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top