Dojo, how destroy a custom widget?

人盡茶涼 提交于 2019-12-13 03:42:11

问题


I have created a custom dijit widget which contains a grid and some buttons.

What is the right way to destroy it? override uninitialize, destroy, destroyRecursive? which method and in which order?

Thanks.


回答1:


Generally uninitialize is the best place to do this, since it is an extension point called within the destroy function before other teardown occurs.

That said, depending on how you are adding your child widgets, you may not actually have to do anything. For instance, if you are defining your child widgets within a template, widgets declared within a template automatically get added to an array which is iterated through in destroy.

If you wanted to be sure, for testing you could connect to the destroy methods of your child widgets to log a message when they get called.



来源:https://stackoverflow.com/questions/7557336/dojo-how-destroy-a-custom-widget

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!