#13026 closed (fixed)
Problem with selecting related object from popup window, opened by lens icon in dynamic created inline row
Reported by: | ramusus | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | ramusus@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
With inline rows created by django's template everithing is ok, but I found problem with rows created dynamically. Problem with changing dynamic id in html containers of created row. Id of lens-icon-link defines incorrectly.
Attachments (3)
Change History (10)
by , 15 years ago
Attachment: | 13026_r12676.diff added |
---|
comment:1 by , 15 years ago
it seems that the numbering on some fields is off by one. it's tricky, because the rows are numbered starting with 1 in the visible parts and the class of the element that surrounds each row. But the actual id's on the rows of the formset start with 0.
Adding a '-1' in the right spot in inlines.js fixed issue for me (with dropdown foreignkeys, the '+' add button and the raw id widget).
I attached a patch.
by , 15 years ago
Attachment: | field_numbering_off_by_one.diff added |
---|
adds a '-1' in both inlines.js and inlines.min.js
comment:2 by , 15 years ago
The problem is not a shift between number of row and id of elements inside this row for me. The problem is starting, when I create new rows dynamically and these rows has a lookup lens icon with link. Id for this link generated incorrectly and it's the reason of this ticket.
comment:3 by , 15 years ago
milestone: | → 1.2 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 15 years ago
ramusus's patch made sense to me after reading the code. In the inlines.js there seems to be a cleanup method, updateElementIndex
, and the anchor tag for the lens icon wasn't getting picked up by this method and its index wasn't correct. I will be attaching a patch, the same as ramusus, but without the extra spacing changes. This patch has been tested and works for me.
by , 15 years ago
Attachment: | 13026_r12676-2.diff added |
---|
Adding 'a' to the list of dom elements updateElementIndex is passed.
comment:5 by , 15 years ago
Has patch: | set |
---|
comment:6 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
this patch only changes .find("input,select,textarea,label") > .find("input,select,textarea,label,a")