Gauravwagh / django-grappelli

Automatically exported from code.google.com/p/django-grappelli
Other
0 stars 0 forks source link

Normal inline add button only allows adding of one additional form #336

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a ModelAdmin with an inline model
2. Click the + or "Add another whatever" link.

What is the expected output? What do you see instead?
I would expect to be able to add as many additional inline forms as I want; 
however, it is only possible to add one before the add links disappear.

What version of the product are you using? On what operating system?
r1399 on MacOS X (10.6.4) with Firefox 3.6.3/Safari 5.0.1/Chrome 5.0.342.9 beta

Please provide any additional information below.

Original issue reported on code.google.com by Stephen....@gmail.com on 10 Jan 2011 at 5:01

GoogleCodeExporter commented 9 years ago
did you set max_num?
I´m not able to reproduce this issue. just tested with both tabular and 
stacked. can you give more details (e.g. taking a look at what happens exactly)?

Original comment by sehmaschine on 10 Jan 2011 at 7:05

GoogleCodeExporter commented 9 years ago
I'm not sure whether you think that I should or should not have max_num set.... 
but I'm getting this issue with the inline admins in a fresh install of the 
grappelli sandbox branch and a clean install of django svn, so I don't think 
that it's just my setup.

In terms of what happens: on loading 
http://127.0.0.1:8000/admin/testdjangoinlines/djangotimefieldsstackedtest/add/, 
there is an add button visible, as well as the text "Add another Time Fields 
Test". When I click any of the adding stuff, an additional form is created, 
TOTAL_FORMS is incremented, and the adding buttons are set to display:none;.

Screenshots are attached; lemme know if you need anything else.

Original comment by Stephen....@gmail.com on 11 Jan 2011 at 10:21

Attachments:

GoogleCodeExporter commented 9 years ago
now we´re getting closer:
it seems you´re using the directory "media" instead of "static". the folder 
"media" is only there because of ticket 326 and will be deleted. sorry for the 
confusion.

easy solution (hopefully): use django.contrib.staticfiles

btw: it seems that there are some minor issues with the model-admin-definition 
in the sandbox (e.g. a class like "ui-collapsible-all-open" doesn´t exist with 
grappelli, "allow_add" doesn´t exist as well). but that shouldn´t cause an 
error.

Original comment by sehmaschine on 12 Jan 2011 at 7:05

GoogleCodeExporter commented 9 years ago
Yeah, you were right. I was serving up the media files, which are slightly 
outdated. Specifically, line 111 of jquery.grp_inline.js is updated in the 
`static` version to include  && (maxForms.val() != ""), which corrects the bug 
I was experiencing.

Original comment by Stephen....@gmail.com on 13 Jan 2011 at 3:17

GoogleCodeExporter commented 9 years ago

Original comment by sehmaschine on 13 Jan 2011 at 8:00