<?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/"
	>

<channel>
	<title>Grummfy&#039;s project &#187; js</title>
	<atom:link href="http://grummfy.be/blog/key/js/feed" rel="self" type="application/rss+xml" />
	<link>http://grummfy.be/blog</link>
	<description>Mes projets, mes rêves, mes envies, ...</description>
	<lastBuildDate>Mon, 02 Jan 2012 00:03:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>[note]Zend Framework et dojo : auto-complétion</title>
		<link>http://grummfy.be/blog/216#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/216#comments</comments>
		<pubDate>Sat, 02 Jan 2010 15:32:29 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[Développement]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[découverte]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=216</guid>
		<description><![CDATA[Ceci est une note rapide ... j'espère produire un article plus intéressant une autre fois ...
Nous allons regarder les bases de l'auto-complétion  avec ZF et Dojo. Dojo simplement parce qu'il est le mieux intégré des frameworks javascript. Sachant que pour l'instant seul jQuery et Dojo sont intégré...]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Ceci est une note rapide &#8230; j&#8217;espère produire un article plus intéressant une autre fois &#8230;</p>
<p style="text-align: justify;">Nous allons regarder les bases de l&#8217;auto-complétion  avec <a href="./?tag=zf#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">ZF</a> et Dojo. Dojo simplement parce qu&#8217;il est le mieux intégré des frameworks javascript. Sachant que pour l&#8217;instant seul jQuery et Dojo sont intégré</p>
<h2>Le code</h2>
<p><em>application/views/scripts/test/index.phtml</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">enable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//activation de dojo</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comboBox</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'toto'</span><span style="color: #339933;">,</span>	<span style="color: #666666; font-style: italic;">//id html de l'élément</span>
	<span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>	<span style="color: #666666; font-style: italic;">//valeur par défaut</span>
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'autocomplete'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>								<span style="color: #666666; font-style: italic;">//activation de l'auto-complétion</span>
		<span style="color: #0000ff;">'store'</span>		<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'stateStore'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'storeType'</span>		<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dojo.data.ItemFileReadStore'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'storeParams'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">baseUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/test/records'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>	<span style="color: #666666; font-style: italic;">//url où les données JSON sont récupérée</span>
		<span style="color: #0000ff;">'searchAttr'</span>		<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'title'</span><span style="color: #339933;">,</span>								<span style="color: #666666; font-style: italic;">//donnée recherchée pour remplir le combobox</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><em>application/layoutes/scripts/layout.phtml</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// ...</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isEnabled</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>	<span style="color: #666666; font-style: italic;">//Évite les chargement inutile ....</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDjConfigOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'isDebug'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span>APPLICATION_ENV <span style="color: #339933;">==</span> <span style="color: #0000ff;">'development'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//affiche une console de deboguage si on est en mode dev</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDjConfigOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'usePlainJson'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>						<span style="color: #666666; font-style: italic;">//utilise du json texte</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLocalPath</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">baseUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/themes/js/dojo/dojo/dojo.js'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			<span style="color: #666666; font-style: italic;">//chemin vers les fichier dojo</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addStyleSheetModule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dijit.themes.tundra'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>					<span style="color: #666666; font-style: italic;">//thème à chargé</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>												<span style="color: #666666; font-style: italic;">//affichage du tout ...</span>
		<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// viennent ensuite nos jabvascript, css, etc</span>
<span style="color: #666666; font-style: italic;">//...</span>
<span style="color: #666666; font-style: italic;">//&lt;/head&gt;</span>
<span style="color: #666666; font-style: italic;">// ne pas oublier la class tundra dans le body</span>
<span style="color: #339933;">&lt;</span>body <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tundra&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #666666; font-style: italic;">//...</span></pre></div></div>

<p><em>application/Bootstrap.php</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//...</span>
<span style="color: #666666; font-style: italic;">//dans _initView()</span>
		<span style="color: #666666; font-style: italic;">//dojo</span>
		Zend_Dojo<span style="color: #339933;">::</span><span style="color: #004000;">enableView</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$view</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//...</span></pre></div></div>

<p><em>application/controllers/TestController.php</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> TestController <span style="color: #000000; font-weight: bold;">extends</span> Zend_Controller_Action
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> indexAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> recordsAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// on désactive l'affichage</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_helper<span style="color: #339933;">-&gt;</span><span style="color: #004000;">layout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">disableLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//on va cherchée les données et les met dans un objet Zend_Dojo_Data</span>
		<span style="color: #000088;">$book</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Default_Model_DbTable_Book<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$dojo</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Dojo_Data<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$book</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetchAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$dojo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">toJson</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// on sort ... c'est pas joli mais en attendant cela fonctionne!</span>
		<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

<h2>Choses à <span style="text-decoration: line-through;">retenir</span> comprendre</h2>
<p>Les choses à retenir :</p>
<ul>
<li><em>storeParams</em> est l&#8217;url où les donnée au format JSON seront prise</li>
<li><em>searchAttr</em> est l&#8217;élément qui va servir pour recherchée les données dans la masse de donnée JSON</li>
<li>ne pas oublier de mettre la class css &#8216;tundra&#8217;</li>
<li>Dojo peut, via ses styles css modifier votre rendu &#8230;</li>
</ul>
<h2>Remarque</h2>
<p>Version de ZF : 1.9.6</p>
<p>Version de Dojo (fourni avec zf dans extras) : 1.3</p>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/216/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mootools 1.1 est sorti!</title>
		<link>http://grummfy.be/blog/29#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://grummfy.be/blog/29#comments</comments>
		<pubDate>Tue, 08 May 2007 10:24:00 +0000</pubDate>
		<dc:creator>Grummfy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sortie]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grummfy.be/blog/?p=29</guid>
		<description><![CDATA[<p>Enfin mootools version 1.1 est sorti!</p>]]></description>
			<content:encoded><![CDATA[<p>Enfin mootools version 1.1 est sorti!</p>
<p><span id="more-29"></span></p>
<p>Mootools est un framework javascript assez simple d&#8217;utilisation une fois son fonctionnement compris. Effets graphiques, ajax, json, sélection d&#8217;éléments à la manière css, &#8230; sont quelqu&#8217;uns des choses disponibles.</p>
<p>Au programme de cette version1.1 de nombreuse chose, mais surtout une pâge de démo!</p>
<ul>
<li><a href="http://forum.mootools.net/viewtopic.php?id=2903" class="broken_link">L&#8217;annonce de la sortie</a></li>
<li>changelog</li>
<li>Nouveauté</li>
<li><a href="http://demos.mootools.net/" class="broken_link">Démo</a></li>
<li><a href="http://docs.mootools.net/" class="broken_link">La documentation</a></li>
<li><a href="http://clientside.cnet.com/wiki/mootorial">The mootorial</a> ou un tuto sur mootools assez complet Mais bien plsu s</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://grummfy.be/blog/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

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

