Opened 15 years ago
Closed 9 years ago
#12713 closed New feature (fixed)
Fire 'onChange' event when adding a new option to a select box
Reported by: | Michał Żarłok | Owned by: | Michał Żarłok |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | js admin onchange |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | yes |
Description
After adding a new option to a select box in admin (by '+' sign) django automatically selects this new option, but it doesn't fire 'onChange' event after that and I think it should. This behaviour could be helpful when there is a js code with an event listener binded to a select box.
This patch adds functionality to fire the event after the change.
Attachments (1)
Change History (9)
by , 15 years ago
Attachment: | fire_onchange_event_after_add_new_option.diff added |
---|
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Marking as accepted, but really I think the solution is to rewrite this using jQuery :)
comment:2 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:3 by , 13 years ago
UI/UX: | set |
---|
comment:7 by , 10 years ago
Patch needs improvement: | set |
---|
comment:8 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This was added in Django 1.8 by https://github.com/django/django/commit/07988744b347302925bc6cc66511e34224db55ab#diff-ec17958cc9f7c2542303557dfc4ad997R90.
first patch