BertrandBordage / django-super-inlines

Adds useful features to inlines, such as the ability to nest them.
BSD 3-Clause "New" or "Revised" License
75 stars 8 forks source link

Add functionality to call javascript hooks before/after adding a new inline form in a formset #4

Open mnzaki opened 9 years ago

mnzaki commented 9 years ago

It's a common issue that one needs to run some code after a new row is added in an inline formset (usually to setup widgets). django-suit has a system in-place to handle this (see https://github.com/darklow/django-suit/issues/337#issuecomment-72213815)

I think a similar system in super-inlines would make super-inlines more super.

django-suit implementation:

  1. Functionality to register new hooks: https://github.com/darklow/django-suit/blob/develop/suit/static/suit/js/suit.js#L4
  2. Hooks are called after adding a new row: https://github.com/darklow/django-suit/blob/develop/suit/templates/admin/edit_inline/stacked.html#L78
BertrandBordage commented 9 years ago

Hi @mnzaki,

Yes, I’ll add that in a near future. As you can see at this line, that’s what I already did for the django-grappelli integration.