<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: Refreshing a data store</title>
	<atom:link href="http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/feed/" rel="self" type="application/rss+xml" />
	<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/</link>
	<description>The definitive resource for all things Dojo: past, present, future.</description>
	<lastBuildDate>Wed, 10 Mar 2010 18:40:27 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: trutwijd</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-411</link>
		<dc:creator>trutwijd</dc:creator>
		<pubDate>Mon, 09 Nov 2009 19:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-411</guid>
		<description>Newer versions of dojo have better API&#039;s for this with 1.4 having the nicest - see:

http://dojocampus.org/content/2009/01/31/refeshing-an-itemfilereadstore/

http://docs.dojocampus.org/dojo/data/ItemFileReadStore#reloading-refreshing-itemfilereadstore-from-a-url-dojo-toolkit-1-4</description>
		<content:encoded><![CDATA[<p>Newer versions of dojo have better API&#8217;s for this with 1.4 having the nicest &#8211; see:</p>
<p><a href="http://dojocampus.org/content/2009/01/31/refeshing-an-itemfilereadstore/" rel="nofollow">http://dojocampus.org/content/2009/01/31/refeshing-an-itemfilereadstore/</a></p>
<p><a href="http://docs.dojocampus.org/dojo/data/ItemFileReadStore#reloading-refreshing-itemfilereadstore-from-a-url-dojo-toolkit-1-4" rel="nofollow">http://docs.dojocampus.org/dojo/data/ItemFileReadStore#reloading-refreshing-itemfilereadstore-from-a-url-dojo-toolkit-1-4</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: clopatofsky</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-316</link>
		<dc:creator>clopatofsky</dc:creator>
		<pubDate>Mon, 16 Feb 2009 21:12:24 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-316</guid>
		<description>the code is note displaying correctly, any question e-mail me.</description>
		<content:encoded><![CDATA[<p>the code is note displaying correctly, any question e-mail me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: clopatofsky</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-313</link>
		<dc:creator>clopatofsky</dc:creator>
		<pubDate>Mon, 16 Feb 2009 21:03:28 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-313</guid>
		<description>Sorry the previous post process the code I wrote:


I had a similar problem, I´m using Dojo 1.1 cause migrating to 1.2 its a very painful issue at this moment. The way I solved the problem was using trutwijd’s suggestion, but setting the tree persistence in false.

You must save into a variable the node’s reference, in my case was easy using a onClick event but maybe in your own apps you’ll need another method:

&lt;pre&gt;



itemSeleccionado = item;
nodoSeleccionado = node;
nodoSeleccionado.state = “UNCHECKED”;
console.log(item);
console.log(nodoSeleccionado);
……………
……………

&lt;!-- arbol --&gt;
&lt;/pre&gt;

Finally when you must collapse and re-expand the corresponding node you must do it with the tree widget, if you do it directly with the node the tree will stay unmodifyed. You can place the following piece of code wherever you need to refresh the node.

&lt;code&gt;
if(nodoSeleccionado.isExpanded)
{
console.log(”tratando de re-expandir”);
arbolWBS._collapseNode(nodoSeleccionado);
arbolWBS._expandNode(nodoSeleccionado);
}
&lt;/code&gt;

Kind regards from Colombia an thanks to trutwijd for helping me to solve this problem. Hope it will help somebody,

Carlos Omaña.</description>
		<content:encoded><![CDATA[<p>Sorry the previous post process the code I wrote:</p>
<p>I had a similar problem, I´m using Dojo 1.1 cause migrating to 1.2 its a very painful issue at this moment. The way I solved the problem was using trutwijd’s suggestion, but setting the tree persistence in false.</p>
<p>You must save into a variable the node’s reference, in my case was easy using a onClick event but maybe in your own apps you’ll need another method:</p>
<pre>

itemSeleccionado = item;
nodoSeleccionado = node;
nodoSeleccionado.state = “UNCHECKED”;
console.log(item);
console.log(nodoSeleccionado);
……………
……………

<!-- arbol -->
</pre>
<p>Finally when you must collapse and re-expand the corresponding node you must do it with the tree widget, if you do it directly with the node the tree will stay unmodifyed. You can place the following piece of code wherever you need to refresh the node.</p>
<p><code><br />
if(nodoSeleccionado.isExpanded)<br />
{<br />
console.log(”tratando de re-expandir”);<br />
arbolWBS._collapseNode(nodoSeleccionado);<br />
arbolWBS._expandNode(nodoSeleccionado);<br />
}<br />
</code></p>
<p>Kind regards from Colombia an thanks to trutwijd for helping me to solve this problem. Hope it will help somebody,</p>
<p>Carlos Omaña.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: clopatofsky</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-312</link>
		<dc:creator>clopatofsky</dc:creator>
		<pubDate>Mon, 16 Feb 2009 21:01:43 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-312</guid>
		<description>Sorry the previous post process the code I wrote:


I had a similar problem, I´m using Dojo 1.1 cause migrating to 1.2 its a very painful issue at this moment. The way I solved the problem was using trutwijd’s suggestion, but setting the tree persistence in false.

You must save into a variable the node’s reference, in my case was easy using a onClick event but maybe in your own apps you’ll need another method:

&lt;code&gt;



itemSeleccionado = item;
nodoSeleccionado = node;
nodoSeleccionado.state = “UNCHECKED”;
console.log(item);
console.log(nodoSeleccionado);
……………
……………

&lt;!-- arbol --&gt;
&lt;/code&gt;

Finally when you must collapse and re-expand the corresponding node you must do it with the tree widget, if you do it directly with the node the tree will stay unmodifyed. You can place the following piece of code wherever you need to refresh the node.

&lt;code&gt;
if(nodoSeleccionado.isExpanded)
{
console.log(”tratando de re-expandir”);
arbolWBS._collapseNode(nodoSeleccionado);
arbolWBS._expandNode(nodoSeleccionado);
}
&lt;/code&gt;

Kind regards from Colombia an thanks to trutwijd for helping me to solve this problem. Hope it will help somebody,

Carlos Omaña.</description>
		<content:encoded><![CDATA[<p>Sorry the previous post process the code I wrote:</p>
<p>I had a similar problem, I´m using Dojo 1.1 cause migrating to 1.2 its a very painful issue at this moment. The way I solved the problem was using trutwijd’s suggestion, but setting the tree persistence in false.</p>
<p>You must save into a variable the node’s reference, in my case was easy using a onClick event but maybe in your own apps you’ll need another method:</p>
<p><code></p>
<p>itemSeleccionado = item;<br />
nodoSeleccionado = node;<br />
nodoSeleccionado.state = “UNCHECKED”;<br />
console.log(item);<br />
console.log(nodoSeleccionado);<br />
……………<br />
……………</p>
<p><!-- arbol --><br />
</code></p>
<p>Finally when you must collapse and re-expand the corresponding node you must do it with the tree widget, if you do it directly with the node the tree will stay unmodifyed. You can place the following piece of code wherever you need to refresh the node.</p>
<p><code><br />
if(nodoSeleccionado.isExpanded)<br />
{<br />
console.log(”tratando de re-expandir”);<br />
arbolWBS._collapseNode(nodoSeleccionado);<br />
arbolWBS._expandNode(nodoSeleccionado);<br />
}<br />
</code></p>
<p>Kind regards from Colombia an thanks to trutwijd for helping me to solve this problem. Hope it will help somebody,</p>
<p>Carlos Omaña.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: clopatofsky</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-311</link>
		<dc:creator>clopatofsky</dc:creator>
		<pubDate>Mon, 16 Feb 2009 20:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-311</guid>
		<description>I had a similar problem, I´m using Dojo 1.1 cause migrating to 1.2 its a very painful issue at this moment. The way I solved the problem was using trutwijd&#039;s suggestion, but setting the tree persistence in false.

You must save into a variable the node&#039;s reference, in my case was easy using a onClick event but maybe in your own apps you&#039;ll need another method:



	itemSeleccionado = item;
	nodoSeleccionado = node;
	nodoSeleccionado.state = &quot;UNCHECKED&quot;;
	console.log(item);
	console.log(nodoSeleccionado);
        ...............
        ...............



Finally when you must collapse and re-expand the corresponding node you must do it with the tree widget, if you do it directly with the node the tree will stay unmodifyed. You can place the following piece of code wherever you need to refresh the node.

if(nodoSeleccionado.isExpanded)
{
	console.log(&quot;tratando de re-expandir&quot;);
	arbolWBS._collapseNode(nodoSeleccionado);
	arbolWBS._expandNode(nodoSeleccionado);
}

Kind regards from Colombia an thanks to trutwijd for helping me to solve this problem. Hope it will help somebody,

Carlos Omaña.</description>
		<content:encoded><![CDATA[<p>I had a similar problem, I´m using Dojo 1.1 cause migrating to 1.2 its a very painful issue at this moment. The way I solved the problem was using trutwijd&#8217;s suggestion, but setting the tree persistence in false.</p>
<p>You must save into a variable the node&#8217;s reference, in my case was easy using a onClick event but maybe in your own apps you&#8217;ll need another method:</p>
<p>	itemSeleccionado = item;<br />
	nodoSeleccionado = node;<br />
	nodoSeleccionado.state = &#8220;UNCHECKED&#8221;;<br />
	console.log(item);<br />
	console.log(nodoSeleccionado);<br />
        &#8230;&#8230;&#8230;&#8230;&#8230;<br />
        &#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p>Finally when you must collapse and re-expand the corresponding node you must do it with the tree widget, if you do it directly with the node the tree will stay unmodifyed. You can place the following piece of code wherever you need to refresh the node.</p>
<p>if(nodoSeleccionado.isExpanded)<br />
{<br />
	console.log(&#8221;tratando de re-expandir&#8221;);<br />
	arbolWBS._collapseNode(nodoSeleccionado);<br />
	arbolWBS._expandNode(nodoSeleccionado);<br />
}</p>
<p>Kind regards from Colombia an thanks to trutwijd for helping me to solve this problem. Hope it will help somebody,</p>
<p>Carlos Omaña.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: trutwijd</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-239</link>
		<dc:creator>trutwijd</dc:creator>
		<pubDate>Tue, 15 Jul 2008 13:37:28 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-239</guid>
		<description>Sorry I don&#039;t have any answers for refreshing a Tree - did talk to one of the Tree dev&#039;s and sounded like the above method (looping over _openedItemIds) should have at least worked.  I&#039;ll try to look into it some more to see if there is a solution.  The main problem seems to be convincing a tree node not to check its local data cache...  It might be helpful to file an enhancement request on trac.  (bugs.dojotoolkit.org)

P.S. binspaul, datastore.close() function is not yet available, need to wait till dojo 1.2 for that.</description>
		<content:encoded><![CDATA[<p>Sorry I don&#8217;t have any answers for refreshing a Tree &#8211; did talk to one of the Tree dev&#8217;s and sounded like the above method (looping over _openedItemIds) should have at least worked.  I&#8217;ll try to look into it some more to see if there is a solution.  The main problem seems to be convincing a tree node not to check its local data cache&#8230;  It might be helpful to file an enhancement request on trac.  (bugs.dojotoolkit.org)</p>
<p>P.S. binspaul, datastore.close() function is not yet available, need to wait till dojo 1.2 for that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: binspaul</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-238</link>
		<dc:creator>binspaul</dc:creator>
		<pubDate>Mon, 14 Jul 2008 11:12:49 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-238</guid>
		<description>Why is there a difference in the store fetched earlier  and the store fetched after ?

console.info(&quot;Tree store (before) : &quot;);
console.info(_this.tree.store);

// Create a new store.
newStore = new dojo.data.ItemFileWriteStore({url: &#039;folders.html?hidValAction=getjsondata&#039;, jsId: &quot;newFolderStore&quot;});
newStore.fetch();
_this.tree.store = newStore;
						
console.info(&quot;Tree store (after) : &quot;);
console.info(_this.tree.store);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The output obtained is :

Tree store (before) :
Object _arrayOfAllItems=[18] _arrayOfTopLevelItems=[18]

GET ........./folders.html?hidValAction=getjsondata

Tree store (after) :
Object _arrayOfAllItems=[0] _arrayOfTopLevelItems=[0]


Best regards,
Binu Paul</description>
		<content:encoded><![CDATA[<p>Why is there a difference in the store fetched earlier  and the store fetched after ?</p>
<p>console.info(&#8221;Tree store (before) : &#8220;);<br />
console.info(_this.tree.store);</p>
<p>// Create a new store.<br />
newStore = new dojo.data.ItemFileWriteStore({url: &#8216;folders.html?hidValAction=getjsondata&#8217;, jsId: &#8220;newFolderStore&#8221;});<br />
newStore.fetch();<br />
_this.tree.store = newStore;</p>
<p>console.info(&#8221;Tree store (after) : &#8220;);<br />
console.info(_this.tree.store);</p>
<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p>
<p>The output obtained is :</p>
<p>Tree store (before) :<br />
Object _arrayOfAllItems=[18] _arrayOfTopLevelItems=[18]</p>
<p>GET &#8230;&#8230;&#8230;/folders.html?hidValAction=getjsondata</p>
<p>Tree store (after) :<br />
Object _arrayOfAllItems=[0] _arrayOfTopLevelItems=[0]</p>
<p>Best regards,<br />
Binu Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: binspaul</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-237</link>
		<dc:creator>binspaul</dc:creator>
		<pubDate>Mon, 14 Jul 2008 09:52:55 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-237</guid>
		<description>For me, the above mentioned methods are not working. The tree is not getting updated.

METHOD 1 :

var _this = this;
newStore = new dojo.data.ItemFileWriteStore({url: &#039;test.html?hidValAction=getjsondata&#039;, jsId: &quot;datStore&quot;});
newStore.fetch();						
_this.tree.model.store.close();
_this.tree.store = newStore;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

METHOD 2 :

var _this = this;

_this.tree.model.store = new dojo.data.ItemFileWriteStore({url: _this.tree.model.store.url});

_this.tree.model.store.fetch();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The store is getting populated. But it is not getting reflected in the tree.

Best regards,
Binu Paul</description>
		<content:encoded><![CDATA[<p>For me, the above mentioned methods are not working. The tree is not getting updated.</p>
<p>METHOD 1 :</p>
<p>var _this = this;<br />
newStore = new dojo.data.ItemFileWriteStore({url: &#8216;test.html?hidValAction=getjsondata&#8217;, jsId: &#8220;datStore&#8221;});<br />
newStore.fetch();<br />
_this.tree.model.store.close();<br />
_this.tree.store = newStore;</p>
<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p>
<p>METHOD 2 :</p>
<p>var _this = this;</p>
<p>_this.tree.model.store = new dojo.data.ItemFileWriteStore({url: _this.tree.model.store.url});</p>
<p>_this.tree.model.store.fetch();</p>
<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p>
<p>The store is getting populated. But it is not getting reflected in the tree.</p>
<p>Best regards,<br />
Binu Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikedef</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-235</link>
		<dc:creator>mikedef</dc:creator>
		<pubDate>Thu, 03 Jul 2008 10:27:08 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-235</guid>
		<description>i tried the following code with my tree and persist was true, but still nothing happens. any other suggestions? i could destroy the old tree any time i need to refresh the data and substitute it with a new one, but this was i have to build all the context menus again as well.

var new_store = new dojo.data.ItemFileReadStore({url: &#039;poptarts.txt&#039;});
new_store.fetch();
		
var myTree = dijit.byId(&quot;tree&quot;);

myTree.store = new_store;

dojo.forEach(myTree._openedItemIds, function (item) {
    n = myTree._itemNodeMap(item);
    n.state = &quot;UNCHECKED&quot;
    n.isExpanded = false;
    n.expand();
});</description>
		<content:encoded><![CDATA[<p>i tried the following code with my tree and persist was true, but still nothing happens. any other suggestions? i could destroy the old tree any time i need to refresh the data and substitute it with a new one, but this was i have to build all the context menus again as well.</p>
<p>var new_store = new dojo.data.ItemFileReadStore({url: &#8216;poptarts.txt&#8217;});<br />
new_store.fetch();</p>
<p>var myTree = dijit.byId(&#8221;tree&#8221;);</p>
<p>myTree.store = new_store;</p>
<p>dojo.forEach(myTree._openedItemIds, function (item) {<br />
    n = myTree._itemNodeMap(item);<br />
    n.state = &#8220;UNCHECKED&#8221;<br />
    n.isExpanded = false;<br />
    n.expand();<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikedef</title>
		<link>http://dojocampus.org/content/2008/06/04/refreshing-a-data-store/comment-page-1/#comment-234</link>
		<dc:creator>mikedef</dc:creator>
		<pubDate>Tue, 01 Jul 2008 17:10:02 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=130#comment-234</guid>
		<description>thanks for the advise. i will take a look at it when i got some time left</description>
		<content:encoded><![CDATA[<p>thanks for the advise. i will take a look at it when i got some time left</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.447 seconds -->
