Skip to content

Commit

Permalink
fix(relations): support modelselect2 fields
Browse files Browse the repository at this point in the history
in modal dialog include support for select2 multiple select fields
that are populated with values from the model (.modelselect2 and .modelselect2multiple).

assuming that no other selectors are needed,
based on /apis_core/generic/forms/__init__.py#L72
  • Loading branch information
gythaogg authored and b1rger committed Nov 19, 2024
1 parent 16c2ef7 commit b7ba802
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apis_core/relations/static/js/relation_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function tohtml(item) {
}
document.body.addEventListener("reinit_select2", function(evt) {
form = document.getElementById(evt.detail.value);
form.querySelectorAll(".listselect2").forEach(element => {
form.querySelectorAll(".listselect2, .modelselect2multiple, .modelselect2").forEach(element => {
$(element).select2({
ajax: {
url: $(element).data("autocomplete-light-url"),
Expand Down

0 comments on commit b7ba802

Please sign in to comment.