Replies: 1 comment 1 reply
-
Hi Thomas, Thanks for reaching out. I am not sure, I fully understand your use case yet. In fact, this behavior can't easily be adapted. You see, That being said, there is always a way. Just not an easy one. I hope this answer helps a little. Cheers! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug Description
Method
result_from_instance
is not called for a default (initial) value. Only methodlabel_from_instance
is called in this case.Steps to Reproduce
If I define a custom widget:
Then I define a form field with an initial value:
In JavaScript in the browser I look at the selected value with:
I expect to see attribute
my_extra
but it is not there, onlyid
andtext
are. Once I select a different value from the options list, then my extra attribute shows up correctly.Expected Behavior
I would expect that
result_from_instance
would be called and my extra attribute would be present when an unchanged default value is queried using$('#id_my_field').select2('data')[0]
Beta Was this translation helpful? Give feedback.
All reactions