#12508: Feature: Dynamically adding inlines
-------------------------------------------+--------------------------------
          Reporter:  zain                  |         Owner:  jezdez          
            Status:  reopened              |     Milestone:  1.2             
         Component:  django.contrib.admin  |       Version:  soc2009/admin-ui
        Resolution:                        |      Keywords:                  
             Stage:  Accepted              |     Has_patch:  1               
        Needs_docs:  0                     |   Needs_tests:  0               
Needs_better_patch:  0                     |  
-------------------------------------------+--------------------------------
Changes (by andraz):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 there's a bug with current implementation, when using ManyToManyField and
 raw_id_admin, the ids of the fields are off-by-one and thus when popup
 closes the value is entered in a row after the one that the user clicked
 on to change.

 Since ticketing system thinks my patch is a spam, here's a simple patch to
 make it work:

 --- inlines.js  (revision 12486)
 +++ inlines.js  (working copy)
 @@ -56,8 +56,8 @@
                                 var template = $("#" + options.prefix +
 "-empty");
                                 var row = template.clone(true).get(0);
 
$(row).removeClass(options.emptyCssClass).removeAttr("id").insertBefore($(template));
 -
 $(row).html($(row).html().replace(/__prefix__/g, nextIndex));
 -
 $(row).addClass(options.formCssClass).attr("id", options.prefix +
 nextIndex);
 +
 $(row).html($(row).html().replace(/__prefix__/g, totalForms.val()));
 +
 $(row).addClass(options.formCssClass).attr("id", options.prefix +
 totalForms.val());
                                 if ($(row).is("TR")) {
                                         // If the forms are laid out in
 table rows, insert
                                         // the remove button into the last
 table cell:

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12508#comment:3>
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.

Reply via email to