#6186 closed bug (notabug)
Objects being shared bewteen instances with the widget factory?
Reported by: | epascarello | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | ui.widget | Version: | 1.8.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Today I discovered a bug in my widget and traced it to the widget code. It appears that my objects are being shared between different instances of the widget.
I update instance A and instance B will also get updated with the new data. When I update A, I do not expect B to also change.
Is this intended behavior with the widget factory? I do not remember it doing it in the previous major dot version.
I created example here: http://jsbin.com/ijulu3/edit
Change History (4)
comment:1 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 12 years ago by
Guess I am going to figure out a better way to maintain data that should be separate and not part of options. :)
comment:3 Changed 12 years ago by
You can define the data inline in _create(). If you need more help, feel free to ask for help on the forum.
Yes, this is intended behavior. We don't do anything to mask the prototypal inheritance other than creating separate option hashes for each instance.