<?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"
	>
<channel>
	<title>Comments on: JsonRestStore &#8212; Custom Services, Schemas, and Lazy Loading</title>
	<atom:link href="http://blog.medryx.org/2008/07/24/jsonreststore-overview/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/</link>
	<description>Observations of a physician software developer.</description>
	<pubDate>Thu, 04 Dec 2008 01:22:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: philou</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-124</link>
		<dc:creator>philou</dc:creator>
		<pubDate>Sun, 30 Nov 2008 18:28:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-124</guid>
		<description>Hi,

I have the same problem as Nr. 8 - Zladivliba: My JSON service returns the data in the correct format (I assume?!?), but the data doesn't show in the JsonRestStore (in Firebug), nor in the dataGrid which the store is attached to. Interestingly, only dojo release 1.2.0. actually calls the url specified in the first Service function:
&lt;code&gt;
var Service = function(query, queryOptions) {
return dojo.xhrGet({url:”/test/”, handleAs:”json” }); }
&lt;/code&gt;
dojo 1.2.1 and 1.2.2. do not make the server call to "/test/" for whatever reason. I can see all this happening (or not) in Firebug. Is that a good thing?

Isn't there a working example of a JsonRestStore implementation to be found anywhere, so we can take it apart with Firebug etc. and see how it works? I have found a "JsonRestStore.js" file in the "dojox/data/tests/stores" folder of the developer distribution, but there seems to be no .html file to go with it?

Many thanks for taking the time to write this tutorial,
philou</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have the same problem as Nr. 8 - Zladivliba: My JSON service returns the data in the correct format (I assume?!?), but the data doesn&#8217;t show in the JsonRestStore (in Firebug), nor in the dataGrid which the store is attached to. Interestingly, only dojo release 1.2.0. actually calls the url specified in the first Service function:<br />
<code><br />
var Service = function(query, queryOptions) {<br />
return dojo.xhrGet({url:”/test/”, handleAs:”json” }); }<br />
</code><br />
dojo 1.2.1 and 1.2.2. do not make the server call to &#8220;/test/&#8221; for whatever reason. I can see all this happening (or not) in Firebug. Is that a good thing?</p>
<p>Isn&#8217;t there a working example of a JsonRestStore implementation to be found anywhere, so we can take it apart with Firebug etc. and see how it works? I have found a &#8220;JsonRestStore.js&#8221; file in the &#8220;dojox/data/tests/stores&#8221; folder of the developer distribution, but there seems to be no .html file to go with it?</p>
<p>Many thanks for taking the time to write this tutorial,<br />
philou</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-123</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Fri, 28 Nov 2008 00:48:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-123</guid>
		<description>This article illustrates why I have tended to use Prototype over Dojo in most cases. Is there a SIMPLE example of accessing a restful resource using JsonRestStore? and the tying is to a DataGrid?

Thx
Eric</description>
		<content:encoded><![CDATA[<p>This article illustrates why I have tended to use Prototype over Dojo in most cases. Is there a SIMPLE example of accessing a restful resource using JsonRestStore? and the tying is to a DataGrid?</p>
<p>Thx<br />
Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kathy Nichols</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-120</link>
		<dc:creator>Kathy Nichols</dc:creator>
		<pubDate>Wed, 12 Nov 2008 20:09:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-120</guid>
		<description>mckatpckoug0r7k2</description>
		<content:encoded><![CDATA[<p>mckatpckoug0r7k2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zladivliba</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-92</link>
		<dc:creator>Zladivliba</dc:creator>
		<pubDate>Wed, 08 Oct 2008 09:36:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-92</guid>
		<description>I tried to use the JsonRestStore with a dojo grid, but it's not working.

My problem is that the grid doesn't show the data ; I see the data is fetch, but either I have a "no data" message written on the grid, either I have an error message, depending on the data format I fetch.  
 
Here's the code :
 


   var Service = function(query, queryOptions) {
        return dojo.xhrGet({url:"/test/", handleAs:"json" });     }
     Service.post = function(id, value) {
        return dojo.xhrGet({url:"/test/", content:{method:"create", id:id, value:value}});     }

store = new dojox.data.JsonRestStore({target:"test", service:Service});

// the grid
dojo.addOnLoad(function(){

        // set the layout structure for the grid version 1.2
        var layout4 = [
        { name: "Test", field: "post_id", width: '40px'},
        ];

        // create a new grid:
        var grid4 = new dojox.grid.DataGrid({
            query: { post_id: '*' },
            store: store,
            structure: layout4,
        }, document.createElement('div'));
       
        dojo.byId("gridContainer4").appendChild(grid4.domNode);
        grid4.startup();
});





Now, /test/ returns this data format :

[
{"post_id":"1","user_id":"1","url":"new-post","ts_created":"2008-10-01 14:16:30","status":"Live","profile_key":"title","profile_value":"new post"},
{"post_id":"2","user_id":"1","url":"new-post-draft","ts_created":"2008-10-01 14:17:38","status":"Draft","profile_key":"title","profile_value":"New post draft"},
{"post_id":"20","user_id":"1","url":"test-3","ts_created":"2008-10-01 22:28:46","status":"Draft","profile_key":"title","profile_value":"test"}
]

I tried also to return another data format that worked using IwriteFileStore that I tried, but that got me nowhere :

{"identifier":"post_id","items":
[{"post_id":"1","user_id":"1","url":"new-post","ts_created":"2008-10-01 14:16:30","status":"Live","profile_key":"title","profile_value":"new post"},
{"post_id":"2","user_id":"1","url":"new-post-draft","ts_created":"2008-10-01 14:17:38","status":"Draft","profile_key":"title","profile_value":"New post draft"}
{"post_id":"20","user_id":"1","url":"test-3","ts_created":"2008-10-01 22:28:46","status":"Draft","profile_key":"title","profile_value":"test"}]
}

Anyone an idea of what's going wrong ?
 
Z.</description>
		<content:encoded><![CDATA[<p>I tried to use the JsonRestStore with a dojo grid, but it&#8217;s not working.</p>
<p>My problem is that the grid doesn&#8217;t show the data ; I see the data is fetch, but either I have a &#8220;no data&#8221; message written on the grid, either I have an error message, depending on the data format I fetch.  </p>
<p>Here&#8217;s the code :</p>
<p>   var Service = function(query, queryOptions) {<br />
        return dojo.xhrGet({url:&#8221;/test/&#8221;, handleAs:&#8221;json&#8221; });     }<br />
     Service.post = function(id, value) {<br />
        return dojo.xhrGet({url:&#8221;/test/&#8221;, content:{method:&#8221;create&#8221;, id:id, value:value}});     }</p>
<p>store = new dojox.data.JsonRestStore({target:&#8221;test&#8221;, service:Service});</p>
<p>// the grid<br />
dojo.addOnLoad(function(){</p>
<p>        // set the layout structure for the grid version 1.2<br />
        var layout4 = [<br />
        { name: "Test", field: "post_id", width: '40px'},<br />
        ];</p>
<p>        // create a new grid:<br />
        var grid4 = new dojox.grid.DataGrid({<br />
            query: { post_id: &#8216;*&#8217; },<br />
            store: store,<br />
            structure: layout4,<br />
        }, document.createElement(&#8217;div&#8217;));</p>
<p>        dojo.byId(&#8221;gridContainer4&#8243;).appendChild(grid4.domNode);<br />
        grid4.startup();<br />
});</p>
<p>Now, /test/ returns this data format :</p>
<p>[<br />
{"post_id":"1","user_id":"1","url":"new-post","ts_created":"2008-10-01 14:16:30","status":"Live","profile_key":"title","profile_value":"new post"},<br />
{"post_id":"2","user_id":"1","url":"new-post-draft","ts_created":"2008-10-01 14:17:38","status":"Draft","profile_key":"title","profile_value":"New post draft"},<br />
{"post_id":"20","user_id":"1","url":"test-3","ts_created":"2008-10-01 22:28:46","status":"Draft","profile_key":"title","profile_value":"test"}<br />
]</p>
<p>I tried also to return another data format that worked using IwriteFileStore that I tried, but that got me nowhere :</p>
<p>{&#8221;identifier&#8221;:&#8221;post_id&#8221;,&#8221;items&#8221;:<br />
[{"post_id":"1","user_id":"1","url":"new-post","ts_created":"2008-10-01 14:16:30","status":"Live","profile_key":"title","profile_value":"new post"},<br />
{"post_id":"2","user_id":"1","url":"new-post-draft","ts_created":"2008-10-01 14:17:38","status":"Draft","profile_key":"title","profile_value":"New post draft"}<br />
{"post_id":"20","user_id":"1","url":"test-3","ts_created":"2008-10-01 22:28:46","status":"Draft","profile_key":"title","profile_value":"test"}]<br />
}</p>
<p>Anyone an idea of what&#8217;s going wrong ?</p>
<p>Z.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: maulin</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-85</link>
		<dc:creator>maulin</dc:creator>
		<pubDate>Thu, 02 Oct 2008 22:55:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-85</guid>
		<description>I made a couple modes -- delete is reserved, so access via obj['delete']. Also added the handleAs attribute, and finally fixed the content= to content:. I hope this solves. When I get a chance I'll actually build the example so you can look at it live.</description>
		<content:encoded><![CDATA[<p>I made a couple modes &#8212; delete is reserved, so access via obj['delete']. Also added the handleAs attribute, and finally fixed the content= to content:. I hope this solves. When I get a chance I&#8217;ll actually build the example so you can look at it live.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Braden Rogness</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-82</link>
		<dc:creator>Braden Rogness</dc:creator>
		<pubDate>Fri, 19 Sep 2008 14:06:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-82</guid>
		<description>Same issue as Mark, I can't make this work in IE. 

Any suggestions?</description>
		<content:encoded><![CDATA[<p>Same issue as Mark, I can&#8217;t make this work in IE. </p>
<p>Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Antrobus</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-81</link>
		<dc:creator>Mark Antrobus</dc:creator>
		<pubDate>Fri, 19 Sep 2008 09:13:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-81</guid>
		<description>&#62;&#62; pagerService.delete = function(id) {
&#62;&#62;  var d = new dojo.Deferred();
&#62;&#62;  d.callback(); //delete is a noop for pagers
&#62;&#62;  return d;
&#62;&#62; }

Do we trip up here with delete being a reserved word in ie?</description>
		<content:encoded><![CDATA[<p>&gt;&gt; pagerService.delete = function(id) {<br />
&gt;&gt;  var d = new dojo.Deferred();<br />
&gt;&gt;  d.callback(); //delete is a noop for pagers<br />
&gt;&gt;  return d;<br />
&gt;&gt; }</p>
<p>Do we trip up here with delete being a reserved word in ie?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Zyp</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-80</link>
		<dc:creator>Kris Zyp</dc:creator>
		<pubDate>Wed, 17 Sep 2008 19:44:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-80</guid>
		<description>That's:
handleAs:"json"</description>
		<content:encoded><![CDATA[<p>That&#8217;s:<br />
handleAs:&#8221;json&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Zyp</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-79</link>
		<dc:creator>Kris Zyp</dc:creator>
		<pubDate>Wed, 17 Sep 2008 19:43:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-79</guid>
		<description>@ben:
Make sure you set your XHR handler to handle the response as JSON:
handle:"json"</description>
		<content:encoded><![CDATA[<p>@ben:<br />
Make sure you set your XHR handler to handle the response as JSON:<br />
handle:&#8221;json&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ben hockey</title>
		<link>http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-78</link>
		<dc:creator>ben hockey</dc:creator>
		<pubDate>Tue, 16 Sep 2008 03:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.medryx.org/2008/07/24/jsonreststore-overview/#comment-78</guid>
		<description>i'm having problems using a service definition the way you've described.  i wonder if things have changed since you wrote this.  any updates?</description>
		<content:encoded><![CDATA[<p>i&#8217;m having problems using a service definition the way you&#8217;ve described.  i wonder if things have changed since you wrote this.  any updates?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
