javascript - Do dojo widgets emit an event when destroyed or can you force one to? -


i have custom widget based on _widgetbase. create in javascript , know when destroyed.

code in parent:

var editrelatedtablewidget = new editrelatedtable().placeat(dom.byid("doceditorwidget"); editrelatedtablewidget.startup(); on(editrelatedtablewidget, "click", function () {console.log("dijit clicked"); }); // works on(editrelatedtablewidget, "destroy", function () { console.log("dijit destroyed"); }); // not ever happen 

i have tried attaching unload, destroy , remove - none of these events fired. widget destroys when button clicked, tried forcing emit event, (in widget):

on.emit(this,"destroy"); this.destroyrecursive(); 

but parent didn't detect event either. suggestions?

we can use uninitialize function of widget. function called when widget destroyed. ex:

 editrelatedtablewidget.uninitialize = function(){ console.log('destroyed');} 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -