Ticket #11452 (closed bug: invalid)
widget dont reset all properties on destroy
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | misc | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
look at this.to at first widget call is 0, after that is 2.
$.widget("test.test", {
to: {}, options: {
optObj: { }
},
_create: function() {
$.Widget.prototype._create.call(this); console.log(Object.keys(this.to).length); console.log(Object.keys(this.options.optObj).length);
this.to1? = 1; this.to2? = { id: 2 }; this.options.optObj3? = 43; this.options.optObj3? = { id: 433 };
},
destroy: function() {
this.to = {}; $.Widget.prototype.destroy.call(this);
}
});
$(document).ready(function() {
$("#divTest").test(); $("#divTest").test("destroy"); $("#divTest").test();
});
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for submitting a ticket to the jQuery bug tracker. Unfortunately we only handle issues to do with jQuery core. For assistance with jQuery UI please either submit your issue to their bug tracker http://bugs.jqueryui.com or ask for further assistance in #jquery on freenode.