Replies: 7 comments
-
I can't set a multi value in the form that opens via activate(prefillPartial... Could you help? |
Beta Was this translation helpful? Give feedback.
-
I fixed some issues here. Can you please check if https://django-formset.fly.dev/bootstrap/issue-many works for you? |
Beta Was this translation helpful? Give feedback.
-
yes, It's great but I interested why when I open DialogModelFrom with selectizemultiple over activate(prefillPartial( all fields opened correct but not ManytoMany field.). When I change the value in the form on which the data in the modal form depends, all the data changes except selectizemultiple. |
Beta Was this translation helpful? Give feedback.
-
When I load a formset for editing an object and press the "edit" button that runs activate(prefillPartial(DishSet.dish_form.dish_fk)) then ModelDIalogForm opens with all fields filled in (including manytomany). But if I change the value in DishSet.dish_form.dish_fk in the loaded formset, then in this case when opening ModelDialogForm all fields change except manytomany. This is a problem. |
Beta Was this translation helpful? Give feedback.
-
Please share your code in a way, so that I can run it out of the box. Maybe then I understand the problem. |
Beta Was this translation helpful? Give feedback.
-
This is all my project https://github.com/amikphoto/foodster It opens the modal form ChangeDishLibraryForm(DialogModelForm): This is problem |
Beta Was this translation helpful? Give feedback.
-
Issue: prefillPartial fails to correctly populate django-selectize fields for ManyToManyFields Description: Specifically, the existing prefillPartial implementation in DjangoFormset.ts only handles setting values for fields where the value is a string or number. It lacks the specific logic required to process an array of values for HTMLSelectElements, particularly those enhanced with the django-selectize custom element. This leads to the field visually appearing empty/unpopulated, even though the data was sent by the server. Subsequently, if the form validation relies on the DOM state (e.g., checking option.selected or using the browser's checkValidity), it might incorrectly flag the required M2M field as empty, causing UI flicker or validation errors. The prefillPartial method in DjangoFormset.ts does not contain logic to handle select[multiple] elements populated by django-selectize when the incoming data value is an Array. To solve this problem I have to modify prefillPartial in djangoformset.ts |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I open DialogModelForm with activate(prefillPartial(DishSet.dish_form.dish_fk)) I got filled form to edit the dish parameters as needed, but I have manytomany field in this form and It doesn't filled correct. Is it correct?
Could you add SelectizeMultiple in prefillPartial?
Beta Was this translation helpful? Give feedback.
All reactions