-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Not a bug, but I am asking if it is possible: pass another form field data value to the popup field view modal box #18
Comments
In order for me to get the initial data from each I had to do:
Lines:
were use to get the initial data from a field. |
Hi. |
Can you add your code to my demo ( in new branch) or prepare your own mini demo for testing? |
Hi, initial = kwargs.get('initial', {}) see the form class below.
In my views.py, I have the following. I run some function to return a list of dictionaries that would be assign to initial attribute of the formset.
If you need more context, please let me know. I got it to work with current setup, but if there any elegant way to make the functionality I am game. |
In form.py: I am passing the ID field to the PopupViewField instance.
That goes in formset:
APReviewFormSet = formset_factory(APReviewForm, extra=0)
In my view, I have: I am setting some initial data for the formset in the get_context_data method.
In my popups.py, I have: I want when the load button is press, the ID from the respective APReviewForm is passed to the SelectionReasonPopUpView (PopupViewField) as shown below. I do some processing based on the ID value before the popup is shown to the user.
This is variant of #5
The text was updated successfully, but these errors were encountered: