Start/Stop Editor Widget

6908
11
06-09-2011 07:43 PM
Donald_EricPimpler
New Contributor II
I need to be able to start and stop the Editor widget as necessary in my application.  I see where I can use Editor.startup() to start the widget.  Is there a method that I can use to "stop()" or disable the widget temporarily and then startup() again later?  The documentation doesn't show the "startup()" method from what I can tell.  I just found it in a sample. Not sure if there is a complementary "stop()" or "disable()".
11 Replies
by Anonymous User
Not applicable
Rookie mistake...it's because it's inside a function. I tried to make a work around but this is still not destroying the widget.
// Destroy editor
 var thing2 = on(stopEdit, "click", function destroyEditor() {
  if (dom.byId("editDivDyn") != null) {
   var widgets = registry.findWidgets(editDivDyn);
   console.log(widgets);
   if (widgets) {
    arrayUtils.forEach(widgets, function(w) {
     w.destroyRecursive();
     w=null;
    });
   }
   domConstruct.destroy("editDivDyn");
  }
 }); 


When I use the 'create' function again I get the error: "Uncaught Error: Tried to register widget with id==editDivDyn but that id is already registered"
0 Kudos
by Anonymous User
Not applicable
Well...glad my goofiness is on record. I needed to search for the widget in one DIV higher up.