jQuery UI widget factory, separate widgets sharing data

jQuery UI widget factory, separate widgets sharing data

Hi All,

I think I'm missing something here.  I thought that when you created a new widget each instance of that widget's attributes are unique to it.  It seems that a change of one internal attribute in one, affects all the other instances.

Here's jsfiddle demonstrating the issue:


In this case, shouldn't each value logged be unique to when the widget was created?  What is going on here?  It seems "that this.something.A = new Date().valueOf()" is actually setting the widgets prototype value of "A".   This doesn't seem right.  How do I ensure that manipulating the internal attributes of one widget doesn't affect future instances of it?

Thanks!