Hello superiors:
Now I have a question like this:
I create a component use :
var myDialog = new dijit.Dialog({
id:"myDialog ",
...
});
when I create this dialog second , the error prompt that the id has been registerred。
now I want to destroy the dialog by id before I create the dialog again ,how can i do it , thanks very much.
Solved! Go to Solution.
Hi xiaoyunn,
You can use this before your create widget call. If a widget with the id is available it'll delete it before creating the widget. Understanding _WidgetBase - The Dojo Toolkit
if (dojo.byId(id)) { dojo.byId(id).destroyRecursive(false); }
Hi xiaoyunn,
You can use this before your create widget call. If a widget with the id is available it'll delete it before creating the widget. Understanding _WidgetBase - The Dojo Toolkit
if (dojo.byId(id)) { dojo.byId(id).destroyRecursive(false); }
Dear Mr Riyas Deen:
Thanks very much ,your answer general right,but maybe change the dojo to dijit like
if (dijit.byId(id)) { dijit.byId(id).destroyRecursive(); }