django-super-inlines icon indicating copy to clipboard operation
django-super-inlines copied to clipboard

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

Open mnzaki opened this issue 9 years ago • 1 comments

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

mnzaki avatar Jun 02 '15 09:06 mnzaki

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.

BertrandBordage avatar Jun 04 '15 08:06 BertrandBordage