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

Extra 0 doesn't work with nested inlines

Open mo-dkrz opened this issue 2 years ago • 1 comments
trafficstars

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

mo-dkrz avatar Mar 23 '23 09:03 mo-dkrz

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.

OskarPersson avatar Mar 28 '23 16:03 OskarPersson