Is it possible to do a full reset and clear the ObjectRegistry? Basically trash everything

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Paul on 2nd May 2014

Is it possible to fully clear and trash everything RGraph - basically reset RGraph back to its page load state before anything was drawn?

I'm creating a single page app with a dashboard style layout, 1-n graphs per page, I want to give the user the ability to load in other dashboards, which may have a completely different set and different number of graphs. So, rather than having to call RGraph.ObjectRegistry.Clear() and then Rgraph.Reset(canvas) on every canvas object, is there anyway I can just call something like Rgraph.Reset() - without passing canvas which will clear and reset everything back to its initial page load state?


Posted by Richard on 2nd May 2014
Hi there,

There isn't a method like that I'm afraid. You could do something like this:

function myReset (canvas)
   // 1. Set all your objects to null

   // 2. Do this: RGraph.ObjectRegistry.clear();

   // 3. Remove the canvas tags from the DOM
   // and/or
   // Clear them and remove the .__object__ reference

Though that still might leave bits and bobs around. And there's no telling what deleting things might do to graph objects created after that.


Add a reply

« Back to message list