How to destroy all widgets enclosed inside a DIV? The attached code works well if enclosing element is a dojo widget (such as form).
Just to reiterate, How to unregister all the widgets enclose inside a DOM element such as DIV.
require(["dojo/ready"], function(ready) {
ready(function(){
var parentNode = dijit.byId('enclosingDivId');
if (parentNode) {
parentNode.destroyRecursive(true);
}
});
})
based on dijit/registry documentation I suggest you to do something like this: