#15760: Feature: JS Hooks for Dynamic Inlines
----------------------------+------------------------------
Reporter: mlavin | Owner: nobody
Type: New feature | Status: new
Milestone: | Component: contrib.admin
Version: SVN | Severity: Normal
Keywords: inlines jquery | Triage Stage: Unreviewed
Has patch: 1 |
----------------------------+------------------------------
It is difficult to access the newly added row when working with dynamic
inlines. This makes it difficult to use widgets which require javascript
bindings (such as auto-complete widgets) in the inlines. I believe this is
the issue that someone was trying to raise in #15693. While the formset
plugin does allow for passing method to be called when a new row is added,
this is always already populated by admin/edit_inline/stacked.html and
admin/edit_inline/tabular.html. If you want to include another method to
be run you need to override these templates completely.
I've attached a patch which adds two events to the formset plugin:
`formsetadd` and `formsetdelete` which are fired by the add and delete
rows respectively. The example usage would be
{{{
django.jQuery('.add-row a').live('formsetadd', function(e, row) {
console.log('Formset add!');
console.log($(row));
});
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/15760>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
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-updates?hl=en.