Skip to content

Instantly share code, notes, and snippets.

@mnickel
Created December 16, 2010 15:53
Show Gist options
  • Save mnickel/743559 to your computer and use it in GitHub Desktop.
Save mnickel/743559 to your computer and use it in GitHub Desktop.
Problem disposing a widget that has a defined id.. I'm creating a widget lyb.widgets.svgEditorViewer and giving it an id: "svgEditorViewer" so that I can refer to it in another place... However, on the dispose event I get some javascript errors in the
jojo.ns("lyb.widgets");
(function() {
lyb.widgets.booksViewer = jojo.widget.create({
name: "lyb.widgets.booksViewer",
path: "/widgets/booksViewer/booksViewer",
prototype: {
initialize: function($super, options) {
$super(options);
},
onReady: function(args) {
var me = this,
domEvents = this.domEvents;
domEvents.bind(me.get("#clickSvgTest"), "click", function() {
//load the tagger widget
var svgEditor = new lyb.widgets.svgEditorViewer({
parent: me,
id: "svgEditorViewer",
on: {
disposed: function() {
//fsm.fire("cancelAction", args);
svgEditor.dispose();
}
},
bookArgs: {
bookId: 839,
sheetId: 140121,
version: 3
}
});
svgEditor.load();
});
}
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment