<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Surviving dojo and zend framework as a new coder</title>
	<atom:link href="http://practicalphpajax.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://practicalphpajax.wordpress.com</link>
	<description>I started to play with dojo and zend framework and well things happen ;-)</description>
	<lastBuildDate>Sun, 04 Sep 2011 16:40:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='practicalphpajax.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Surviving dojo and zend framework as a new coder</title>
		<link>http://practicalphpajax.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://practicalphpajax.wordpress.com/osd.xml" title="Surviving dojo and zend framework as a new coder" />
	<atom:link rel='hub' href='http://practicalphpajax.wordpress.com/?pushpress=hub'/>
		<item>
		<title>EC2 + RDS availability</title>
		<link>http://practicalphpajax.wordpress.com/2011/09/04/ec2-rds-availability/</link>
		<comments>http://practicalphpajax.wordpress.com/2011/09/04/ec2-rds-availability/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 16:40:50 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=98</guid>
		<description><![CDATA[I&#8217;ve been testing Amazon EC2 with RDS now for a few month and I&#8217;ve had time enough to make an opinion about the quality of service. So here it is : I think IT SUCKS ! So sorry let me correct this : I think it really sucks ! Why ? Let&#8217;s look a numbers, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=98&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been testing Amazon EC2 with RDS now for a few month and I&#8217;ve had time enough to make an opinion about the quality of service. So here it is : I think IT SUCKS !<br />
So sorry let me correct this : I think it <strong>really </strong>sucks !</p>
<p>Why ? Let&#8217;s look a numbers, numbers don&#8217;t like. So I&#8217;ve been using another server from OVH a french server provider and I&#8217;ve had 100% uptime for many years. Yes you read well, not a single problem for years, running multiple websites, with a mysql engine on local.<br />
So I guess I expected quality of service. Maybe. It would be fair to say so.</p>
<p>And what do I get with EC2 ? This month I&#8217;m having 99.42 measured by Pingdom. Yes 99.42, with 2 outages and 4h 20m 58s downtime. Why did I get that ? I have absolutely no idea the only thing I can tell you is that it can&#8217;t be the software who&#8217;s responsible since no one is using my plateform&#8230; Yes I set this plateform only for test purpeose !<br />
And the 99,42 is costing me 200 euros per month (with a 300 euros AMI reservation  upfront). Compared to OVH 50 euros per month for 100% uptime well&#8230; </p>
<p>Oh, ok I&#8217;m not exactly fair here since I&#8217;m renting 2 machines, one for the db and one for the webserver so what I really would have is to pay 100 euros for the equivalent at OVH. WRONG ! because for 100 euros I&#8217;d get 2 REAL servers there, oh boy why did I fall for this marketing crap !</p>
<p>But maybe, hopefully you won&#8217;t !</p>
<p>So think twice before using EC2. My experience is that it&#8217;s not worth it. Get a real server, not virtual images that get disconnected from the Internet for no reason (and they didn&#8217;t even told me the reason why my images weren&#8217;t available !!!). </p>
<p>So is the hard world of Internet development. </p>
<p>So long EC2 I&#8217;m leaving you for more reliable backends.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=98&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2011/09/04/ec2-rds-availability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
		<item>
		<title>How to create a Multi Select  declaratively and populate it programmatically</title>
		<link>http://practicalphpajax.wordpress.com/2011/06/13/how-to-create-a-multi-select-declaratively-and-populate-it-programmatically/</link>
		<comments>http://practicalphpajax.wordpress.com/2011/06/13/how-to-create-a-multi-select-declaratively-and-populate-it-programmatically/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 12:00:41 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>
		<category><![CDATA[declaratively]]></category>
		<category><![CDATA[multi select]]></category>
		<category><![CDATA[multiselect]]></category>
		<category><![CDATA[populate]]></category>
		<category><![CDATA[programmatically]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=92</guid>
		<description><![CDATA[Again big pain to find the solution of this one. I was trying to create a MultiSelect declaratively, and the problem was I had to populate it programmatically. Well it appears it isn&#8217;t as bad as it looks as long as you know that dojo data doesn&#8217;t apply to multiSelect. So the only thing you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=92&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Again big pain to find the solution of this one. I was trying to create a MultiSelect declaratively, and the problem was I had to populate it programmatically.</p>
<p>Well it appears it isn&#8217;t as bad as it looks as long as you know that dojo data doesn&#8217;t apply to multiSelect. So the only thing you need is to add html options inside your widget. Mmmm</p>
<p>So the solution looks like that :<br />
<code> (removing divs because wordpress won't show them...)<br />
 div dojoType="dijit.form.MultiSelect" dojoAttachPoint="List"</p>
<p>/div<br />
</code></p>
<p>And the code looks like this :</p>
<p>// Add each of the items<br />
dojo.forEach(items, function(item){<br />
var c = dojo.doc.createElement(&#8216;option&#8217;);<br />
c.innerHTML = item.Name;<br />
c.value = item.Value;<br />
this.List.containerNode.appendChild(c);<br />
}, this);</p>
<p>Simple no ?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=92&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2011/06/13/how-to-create-a-multi-select-declaratively-and-populate-it-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
		<item>
		<title>How to enable / disable a button in javascript</title>
		<link>http://practicalphpajax.wordpress.com/2011/06/12/how-to-enable-disable-a-button-in-javascript/</link>
		<comments>http://practicalphpajax.wordpress.com/2011/06/12/how-to-enable-disable-a-button-in-javascript/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 11:06:54 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>
		<category><![CDATA[disable button]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=90</guid>
		<description><![CDATA[I forget about this all the time&#8230; I mean I spend times and times again trying to figure out solutions of problems I already solved. Baaahhh that sucks. I really need to get organized ! Well I guess it&#8217;s the reason why I got this blog online at the first place. Well today&#8217;s a simple [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=90&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I forget about this all the time&#8230; I mean I spend times and times again trying to figure out solutions of problems I already solved. Baaahhh that sucks. I really need to get organized !</p>
<p>Well I guess it&#8217;s the reason why I got this blog online at the first place. Well today&#8217;s a simple problem I spend another 10 minutes trying to find out how to solve: how to enable/disable a button, or an object in javascript : </p>
<p>Here&#8217;s the code :  this.CommentMsgBox.setAttribute(&#8216;disabled&#8217;, false); </p>
<p>Well if anyone has a solution for organiszing that kind of problems/solutions I&#8217;m in guys ! </p>
<p>I recently came to use netbeans (I used zend studio before) ; I have to say it&#8217;s better than zend studio but it really lacks quick access to code snippets. At least I haven&#8217;t found out where and how to add them (sucks&#8230;).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=90&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2011/06/12/how-to-enable-disable-a-button-in-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome PEM !</title>
		<link>http://practicalphpajax.wordpress.com/2011/06/03/welcome-pem/</link>
		<comments>http://practicalphpajax.wordpress.com/2011/06/03/welcome-pem/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 11:10:21 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=86</guid>
		<description><![CDATA[Hey guys, PEM is building his blog @ http://codeblog.bigbrowser.net/ with great dojo stuff ! Leave him a few cool comments !!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=86&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hey guys, PEM is building his blog @ http://codeblog.bigbrowser.net/ with great dojo stuff !</p>
<p>Leave him a few cool comments !!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=86&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2011/06/03/welcome-pem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
		<item>
		<title>And that&#8217;s a funny bug !</title>
		<link>http://practicalphpajax.wordpress.com/2011/03/03/and-thats-a-funny-bug/</link>
		<comments>http://practicalphpajax.wordpress.com/2011/03/03/and-thats-a-funny-bug/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 09:09:38 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>
		<category><![CDATA[My best bugs]]></category>
		<category><![CDATA[dojo bugs]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=81</guid>
		<description><![CDATA[Hey sometimes I have to admit, we&#8217;re really out of our minds. I was programming a publish function for an article and, I got this bug, it&#8217;s so funny I&#8217;ve decided to make a post out of it. Here&#8217;s the code : PublishArticle: function(){ if(this.PublishButton.get("label") == "Publish"){ this.State = "Published"; this.SaveArticle(); this.PublishButton.set("label", "Unpublish"); } if(this.PublishButton.get("label") [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=81&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hey sometimes I have to admit, we&#8217;re really out of our minds. I was programming a publish function for an article and, I got this bug, it&#8217;s so funny I&#8217;ve decided to make a post out of it. Here&#8217;s the code : </p>
<p><code><br />
 PublishArticle: function(){</p>
<p>        	if(this.PublishButton.get("label") == "Publish"){<br />
        		this.State = "Published";<br />
        		this.SaveArticle();<br />
        		this.PublishButton.set("label", "Unpublish");<br />
        	}<br />
        	if(this.PublishButton.get("label") == "Unpublish"){<br />
        		this.State = "Draft";<br />
        		this.SaveArticle();<br />
        		this.PublishButton.set("label", "Publish");<br />
        	}<br />
        },</p>
<p></code></p>
<p>Aint&#8217; that crazy ?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=81&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2011/03/03/and-thats-a-funny-bug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
		<item>
		<title>The bug of the year (or maybe you can do better ;-)</title>
		<link>http://practicalphpajax.wordpress.com/2010/05/11/the-bug-of-the-year-or-maybe-you-can-do-better/</link>
		<comments>http://practicalphpajax.wordpress.com/2010/05/11/the-bug-of-the-year-or-maybe-you-can-do-better/#comments</comments>
		<pubDate>Tue, 11 May 2010 16:25:59 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>
		<category><![CDATA[My best bugs]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[custom widgets]]></category>
		<category><![CDATA[JsonRestStore]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=68</guid>
		<description><![CDATA[Damn sometimes&#8230; Sometimes we have bugs that seem just impossible. Well I&#8217;ve just had one, I solved I just can&#8217;t resist posting it here. Guys I have to tell you it&#8217;s the most stupid bug I&#8217;ve sold, I laugh so much when I understood what happend. Ahhh life&#8217;s funny sometimes Here it is. I&#8217;m querying [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=68&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Damn sometimes&#8230; Sometimes we have bugs that seem just impossible. Well I&#8217;ve just had one, I solved I just can&#8217;t resist posting it here. Guys I have to tell you it&#8217;s the most stupid bug I&#8217;ve sold, I laugh so much when I understood what happend. Ahhh life&#8217;s funny sometimes <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Here it is. </p>
<p>I&#8217;m querying a JsonRestStore that sends back this data : </p>
<p>[{"id":"15","item_id":"1","item_type":"lunches","user_id":"17","object":"T","date":"0000-00-00","child_of":"0","TG":"","TD":"Yes","TP":"","TA":"Connect","TAD":"","D":"0000-00-00","NC":""},{"id":"1","item_id":"1","item_type":"opportunities","user_id":"17","object":"T","date":"2010-02-08","child_of":"0","TG":"re","TD":"Yes","TP":"2","TA":"Older","TAD":"v","D":"0000-00-00","NC":""},<br />
{"id":"3","item_id":"1","item_type":"opportunities","user_id":"17","object":"T","date":"2010-02-08","child_of":"0","TG":"re","TD":"Yes","TP":"2","TA":"Older","TAD":"v","D":"0000-00-00","NC":""},<br />
{"id":"2","item_id":"1","item_type":"opportunities","user_id":"17","object":"T","date":"2010-02-08","child_of":"0","TG":"re","TD":"Yes","TP":"2","TA":"Older","TAD":"v","D":"0000-00-00","NC":""}]</p>
<p>Well I removed the content of the data but that&#8217;s of no importance. Note that I had about 25 records sent from the JsonRestStore that looked pretty much the same except one field : item_type was for item 1 &#8220;lunches&#8221; and for all the rest &#8220;opportunities&#8221;. </p>
<p>Then my code, inside a dojo widget I&#8217;m fetching the JsonRestStore and getting the items. Except I want to order items using the field item_type.</p>
<p><code><br />
// Fetch the objects<br />
			this.store.fetch({</p>
<p>				query: {object:"Task"},<br />
				sort: sortKeys, // Order by... date DESC<br />
				onComplete: dojo.hitch(this, function(items,request){</p>
<p>					opportunities="";<br />
					lunches="";</p>
<p>							// Now format each element<br />
			        		for (var i = 0; i &lt; items.length; i++){</p>
<p>			                	var item=items[i];</p>
<p>			                	if(item.item_type=&quot;lunches&quot;){</p>
<p>				                	lunches += &#039;
<div></div>
<p>';<br />
				                	//console.log(item.item_type + item.id);<br />
			                	}<br />
			                	else if (item.item_type="opportunities"){</p>
<p>				                	lunches += '
<div></div>
<p>';<br />
			                	}<br />
			        		}</p>
<p>			        		// Add titles to the elements<br />
			        		if(lunches !=""){</p>
<p>			        			lunches = "<br />
<h2> Lunches </h2>
<p>" + lunches ;<br />
			        		}<br />
			        		if(opportunities !=""){</p>
<p>			        			opportunities = "<br />
<h2>Opportunities</h2>
<p>" + opportunities ;<br />
			        		}</p>
<p>			        		this.TaskList.innerHTML =  lunches + opportunities ;</p>
<p>			        		dojo.parser.parse(this.domNode);<br />
</code></p>
<p>Guess what happend&#8230; All my items went on the lunches category. But WHY WHY WHY ???<br />
You&#8217;ll find out I&#8217;m sure, and laugh a lot, hopefully <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=68&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2010/05/11/the-bug-of-the-year-or-maybe-you-can-do-better/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
		<item>
		<title>How to override a function in dojo</title>
		<link>http://practicalphpajax.wordpress.com/2010/05/05/how-to-override-a-function-in-dojo/</link>
		<comments>http://practicalphpajax.wordpress.com/2010/05/05/how-to-override-a-function-in-dojo/#comments</comments>
		<pubDate>Wed, 05 May 2010 13:55:12 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>
		<category><![CDATA[function override]]></category>
		<category><![CDATA[hook]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=65</guid>
		<description><![CDATA[Still working on my Tree, irc&#8217;s magic chamber (#dojo) gave me a solution I tend to forget from times to times related to extending some of dojo&#8217;s functions (credits dmachi, thanks man Here it is : myStore = new dojox.data.JsonRestStore({target:"/objects/", labelAttribute:"Task_Action"}); myModel = new dijit.tree.ForestStoreModel({ store: myStore, deferItemLoadingUntilExpand: true, query: {object:'Task'}, rootLabel:'test test' }); dojo.extend(dijit.Tree, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=65&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Still working on my Tree, irc&#8217;s magic chamber (#dojo) gave me a solution I tend to forget from times to times related to extending some of dojo&#8217;s functions (credits dmachi, thanks man <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Here it is : </p>
<p><code>myStore = new dojox.data.JsonRestStore({target:"/objects/", labelAttribute:"Task_Action"});</p>
<p>	myModel = new dijit.tree.ForestStoreModel({<br />
		store: myStore,<br />
		deferItemLoadingUntilExpand: true,<br />
		query: {object:'Task'},<br />
		rootLabel:'test test'</p>
<p>	});</p>
<p>	dojo.extend(dijit.Tree, {_createTreeNode: function(args){</p>
<p>                console.log("this is cool stuff");<br />
		console.log("_createTreeNode: ", args);<br />
		return new dijit._TreeNode(args);</p>
<p>	}}<br />
	);</p>
<p>	myTree = new dijit.Tree({<br />
		id: "myTree",<br />
		model: myModel,<br />
		persist: false,<br />
		label:'test'<br />
	});</p>
<p>	dojo.byId("container").appendChild(myTree.domNode);<br />
	myTree.startup();<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=65&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2010/05/05/how-to-override-a-function-in-dojo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
		<item>
		<title>Building a custom widget using dojo.charting to make nice charts</title>
		<link>http://practicalphpajax.wordpress.com/2010/05/05/building-a-custom-widget-using-dojo-charting-to-make-nice-charts/</link>
		<comments>http://practicalphpajax.wordpress.com/2010/05/05/building-a-custom-widget-using-dojo-charting-to-make-nice-charts/#comments</comments>
		<pubDate>Wed, 05 May 2010 09:31:08 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[custom widgets]]></category>
		<category><![CDATA[dijit]]></category>
		<category><![CDATA[dojo charts]]></category>
		<category><![CDATA[dojo widgets]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=63</guid>
		<description><![CDATA[Here&#8217;s a good idea : make a new widget that will display charts related to a page. I had a few problems building this since the template must have set some parameters like style, width and height otherwise your chart wont&#8217; display and you&#8217;ll get a wierd error. I&#8217;ll give you a very simple example [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=63&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a good idea : make a new widget that will display charts related to a page. I had a few problems building this since the template must have set some parameters like style, width and height otherwise your chart wont&#8217; display and you&#8217;ll get a wierd error. I&#8217;ll give you a very simple example on how to start building this idea. </p>
<p>Here&#8217;s my template :<br />
<code> </p>
<div class="stats">
<div class="Title">Statistics</div>
<div class="Content" id="test" style="width:200px;height:150px;"></div>
</div>
<p></code><br />
Note that the style=&#8221;width &#8230;&#8221; *must* be there otherwise the chart won&#8217;t display.<br />
Let&#8217;s continue &#8230;<br />
<code><br />
dojo.provide("mywidget.stats");<br />
dojo.require("dijit._Widget");<br />
dojo.require("dijit._Templated");<br />
dojo.require("dojox.charting.Chart2D");</p>
<p>dojo.declare("mywidget.stats",<br />
	[dijit._Widget,dijit._Templated],<br />
	{</p>
<p>		widgetsInTemplate:true,</p>
<p>		templatePath: dojo.moduleUrl("mywidget","templates/Stats.html"),</p>
<p>		postMixInProperties: function(){</p>
<p>		},</p>
<p>		postCreate: function(){</p>
<p>	        var chart1 = new dojox.charting.Chart2D("test");<br />
	        chart1.addPlot("default", {type: "Pie"});<br />
	        chart1.addAxis("x");<br />
	        chart1.addAxis("y", {vertical: true});<br />
	        chart1.addSeries("Series 1", [1, 2, 2, 3, 4, 5, 5, 7]);<br />
	        chart1.render();</p>
<p>		},</p>
<p>		startup: function(){</p>
<p>		},</p>
<p>	}<br />
);<br />
</code></p>
<p>Well nothing big here but it works <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
I&#8217;m trying actually to develop multiple statitics that I&#8217;ll probably end putting in tabs. We&#8217;ll see, maybe later if I have good results I&#8217;ll post somehting here <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>See ya guys !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=63&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2010/05/05/building-a-custom-widget-using-dojo-charting-to-make-nice-charts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
		<item>
		<title>Zend framework and JsonRestStore</title>
		<link>http://practicalphpajax.wordpress.com/2010/04/29/zend-framework-and-jsonreststore/</link>
		<comments>http://practicalphpajax.wordpress.com/2010/04/29/zend-framework-and-jsonreststore/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 20:27:49 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[dojo form]]></category>
		<category><![CDATA[dojo query]]></category>
		<category><![CDATA[JsonRestStore]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=59</guid>
		<description><![CDATA[I spend quiet a lot of time on this one, I posted arround here and there to find the anwser on how to make a JsonRestStore happend with Zend Framework. There are quiet a few tutorials out there but my main problem was a response from the server when POST request was made (when creating [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=59&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I spend quiet a lot of time on this one, I posted arround here and there to find the anwser on how to make a <strong>JsonRestStore </strong>happend with <strong>Zend Framework</strong>. There are quiet a few tutorials out there but my main problem was a response from the server when POST request was made (when creating a new document). </p>
<p>Well here&#8217;s the solution :<br />
<code>$this-&gt;getResponse()<br />
			-&gt;setHttpResponseCode(201)<br />
			-&gt;setHeader('Content-Type', 'application/json', true)<br />
			-&gt;setHeader("Location", 'http://mywebsite' . $this-&gt;_request-&gt;getRequestUri() . $id);</p>
<p>		$params['id'] = $id;<br />
		return $params;<br />
</code><br />
First : you need to send back a code 201. Second, you need to send the url of the store with the new id (ex : mysite/store/4<br />
Then you need to send back the content of the item created + the id in order to be able to play with it with DOJO. Otherwise, no fun. </p>
<p>Here&#8217;s the dojo part of the code :<br />
<code><br />
testStore 	= new dojox.data.JsonRestStore({jsId:"tStore", target:"/test/", idAttribute:"id" });</p>
<p>	// Get the content of a form with a magic <a href="http://practicalphpajax.wordpress.com/2010/04/28/the-magic-of-dojo-query/">dojo query</a><br />
	data = {};<br />
	dojo.query(" textarea, .ArticleNewFormElement &gt; input").forEach(function(node, index, arr){<br />
		   if(node.id){<br />
		      data[node.id] = dijit.byId(node.id).attr("value");<br />
		}<br />
	});</p>
<p>	// Add the item to the DataStore<br />
	var newClient = clientsStore.newItem(data);</p>
<p>	// Save it back to the server<br />
    clientsStore.save({onComplete:function(item) {</p>
<p>        // Now you can play with the ID of the element you just created, so cool !<br />
        console.log(newClient.id); </p>
<p>    }<br />
	});<br />
</code></p>
<p>Note that I changed a few variables here and there for my blog without rechecking the entire stuff so re-read it if you need to use it, but it works. JsonRestStore is your friend I tell you !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=59&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2010/04/29/zend-framework-and-jsonreststore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
		<item>
		<title>Having fun with dojo.query and JsonRestStores to get user input back to servers</title>
		<link>http://practicalphpajax.wordpress.com/2010/04/29/having-fun-with-dojo-query-and-jsonreststores-to-get-user-input-back-to-servers/</link>
		<comments>http://practicalphpajax.wordpress.com/2010/04/29/having-fun-with-dojo-query-and-jsonreststores-to-get-user-input-back-to-servers/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 09:54:09 +0000</pubDate>
		<dc:creator>zladivliba</dc:creator>
				<category><![CDATA[dojo]]></category>
		<category><![CDATA[dojo form]]></category>
		<category><![CDATA[dojo query]]></category>
		<category><![CDATA[xhr Get]]></category>
		<category><![CDATA[xhr Post]]></category>

		<guid isPermaLink="false">http://practicalphpajax.wordpress.com/?p=57</guid>
		<description><![CDATA[I&#8217;m having so much fun with dojo.query. Here&#8217;s as simple way to send back input elements to your server using a JsonRestStore : clientStore = new dojox.data.JsonRestStore({ jsId:"MyStore", target:"/mystore/", idAttribute:"id" }); // Get the content of the form data = {}; dojo.query(" textarea, .ArticleNewFormElement &#62; input").forEach(function(node, index, arr){ if(node.id){ data[node.id] = dijit.byId(node.id).attr("value"); } }); var [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=57&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m having so much fun with dojo.query. Here&#8217;s as simple way to send back input elements to your server using a JsonRestStore :</p>
<p><code>clientStore = new dojox.data.JsonRestStore({<br />
	jsId:"MyStore",<br />
	target:"/mystore/",<br />
	idAttribute:"id"<br />
});</p>
<p>// Get the content of the form<br />
data = {};<br />
dojo.query(" textarea, .ArticleNewFormElement &gt; input").forEach(function(node, index, arr){<br />
	   if(node.id){<br />
	      data[node.id] = dijit.byId(node.id).attr("value");<br />
	}<br />
});</p>
<p>var newClient = clientStore.newItem(data);</p>
<p>clientStore.save();<br />
</code></p>
<p>When I think I use to do Title = dijit.byId(&#8220;Title&#8221;)&#8230; and then collect each of the elements and then send this through an XhrPost, wha, I&#8217;m really goind quicker now. Well I guess that&#8217;s the whole deal of beeing a beginner at things <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/practicalphpajax.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/practicalphpajax.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/practicalphpajax.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/practicalphpajax.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/practicalphpajax.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/practicalphpajax.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/practicalphpajax.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/practicalphpajax.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/practicalphpajax.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/practicalphpajax.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/practicalphpajax.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/practicalphpajax.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/practicalphpajax.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/practicalphpajax.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=practicalphpajax.wordpress.com&amp;blog=12934781&amp;post=57&amp;subd=practicalphpajax&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://practicalphpajax.wordpress.com/2010/04/29/having-fun-with-dojo-query-and-jsonreststores-to-get-user-input-back-to-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9358c343db6058581cfdf1a28ab45926?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zladivliba</media:title>
		</media:content>
	</item>
	</channel>
</rss>
