Get all widgets inside an element

From the dojo docs in dijit.registry, I see that the method forEachaccepts the last parameter thisObject. But it is not like this object. Is it a dijit widget or dojo object?

I want to destroy all widgets inside an element (which will be replaced by AJAX) so that they can be parsed again without an identity conflict.

dijit.registry.forEach(function(w) {
    w.destroyRecursive();
}, dojo.byId("ajaxElement"));

But it destroys ALL widgets on the page ...

+5
source share
1 answer

thisObjectis a scope object for calling a function passed as the first parameter forEach.

A few solutions that you can use in this case:

1) dijit.findWidgets, DOM node . dijit.findWidgets , domnode 2) dojo.parser.parse , , dijit.parser.parse.

3) dijit.registry.filter , .

+3

All Articles