When I was working on a similar issue for django-selectable I created an issue to address this problem with a simple proof of concept patch https://code.djangoproject.com/ticket/15760. However I never followed through with the ticket to try to get something like this added. In the meantime another ticket was created and fixed which solves a large portion of the problem https://code.djangoproject.com/ticket/18241. With this change you can catch the click event of the add button. I still feel like the admin inline javascript is not particularly flexible and having some clearly documented hooks for this use case would be nice.
For what it's worth my solution in django-selectable was to patch the formset function to include my callback https://bitbucket.org/mlavin/django-selectable/src/efede3aa83ec6d372626eaac6f54c188287ec3d2/selectable/static/selectable/js/jquery.dj.selectable.js?at=default#cl-289 Not the prettiest solution but it works. Best, Mark On Friday, November 9, 2012 6:30:17 AM UTC-5, is_null wrote: > > Hi all, > > Is it possible to trigger an event on add-another ? > > Or is there a better solution to work around this problem ? > https://github.com/yourlabs/django-autocomplete-light/blob/master/autocomplete_light/static/autocomplete_light/widget.js#L267 > > Thanks for answering > > Regards > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/zvzeX-CiNDgJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
