django-nested-inline
django-nested-inline copied to clipboard
Extra 0 doesn't work with nested inlines
Dear all,
When I set extra=0, nested inlines don't work and on the other hand, I get the following error in the console:
Uncaught TypeError: Cannot read properties of undefined (reading 'fn')
But using extra=1 all is well. I appreciate it if you give me a hint or solution regarding this issue.
Cheers,
Mo
This seems to be a duplicate of #4, #28 and #67. I think what is said here still applies: https://github.com/OskarPersson/django-nested-inline/issues/4#issuecomment-60661328
The function that creates the new elements when clicking on "Add another ..." depends on already visible elements when it creates the new ones:
https://github.com/OskarPersson/django-nested-inline/blob/595c8ec3051df958fe38e5deb2196b3917b15e78/nested_inline/static/admin/js/inlines-nested.js#L287-L296
Therefore since no elements exists to choose from when using extra=0, it doesn't know how to properly create the new ones.