serializing forms which use FilteredSelectMultiple
|Reported by:||alan.kesselmann@…||Owned by:|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This is minor but annoying problem.
I use django.contrib.admin.widgets.FilteredSelectMultiple on publicly visible page and post forms contents with ajax - gathering data with form.serialize(). When doing so i noticed that info from the select widget was not sent to server. I followed problem to django/contrib/admin/media/js/SelectBox.js and to SelectBox objects render method. The problem why jQuery.serialize() does not serialize selects contents is simply because those options arent selected after moving from one select to another. And they arent selected because SelectBox.render() is called after each moving - and after it none of the options have selected attribute.
Like i said - it is not big problem and it has workaround - you have to select the options in 2nd select if you want form.serialize() to pick up its contents. But when selects contents are many, then this is not easy. It would be much easyer if they remained selected after beeing moved from one select to another.
Change History (11)
comment:1 Changed 5 years ago by anonymous
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- UI/UX set
comment:2 Changed 5 years ago by julien
- Triage Stage changed from Unreviewed to Design decision needed
comment:7 in reply to: ↑ 5 Changed 5 years ago by alan.kesselmann@…
- Type changed from Bug to New feature
comment:8 Changed 5 years ago by jacob
- Triage Stage changed from Design decision needed to Someday/Maybe
comment:9 Changed 2 years ago by rednaw
- Keywords nlsprint14 added
- Owner changed from nobody to rednaw
- Status changed from new to assigned