I am extensively using declarative dojo DataStores in my application and connecting them to various declarative data driven Widgets. The problem comes in when I attempt to "destroy" the ContentPane that contains the DataStores. All the declarative examples using datastores use the attribute jsId
to have the dojo parser set the datastore as a variable, which then the control is pointed at. For example I use the following:
<div dojoType="dojo.data.ItemFileReadStore" id="processList" jsId="processList"
url="json/processlist.json.php"></div>
<input dojoType="dijit.form.FilteringSelect" name="processSelect" id="processSelect"
value="null" store="processList" searchAttr="label" />
It works like a charm, but the problem is that when I destroy the parent ContentPane I notice that the variable processList
is still available in the browser. After using various parts of the application, I end up lots and lots of little data stores all over the place, which obviously is a rather large "memory leak".
How do I either avoid registering the datastore as a variable (I tried dijit.byId()
in the store
attribute without success) or how do I automatically have these datastores clean themselves up?