<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Loiane Groner</title><link>http://www.loiane.com</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Loiane" /><description>Java, Ext JS, cursos online, desenvolvimento e tecnologia</description><language>en</language><lastBuildDate>Thu, 17 May 2012 00:30:24 PDT</lastBuildDate><generator>http://wordpress.org/?v=</generator><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Loiane" /><feedburner:info uri="loiane" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><feedburner:emailServiceId>Loiane</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>Começando com Phone Gap (Cordova): Hello Word iOS</title><link>http://feedproxy.google.com/~r/Loiane/~3/YlnUZv7vz0U/</link><category>Phone Gap (Cordova)</category><category>Cordova</category><category>iOS</category><category>PhoneGap</category><category>XCode</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Thu, 17 May 2012 00:30:24 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4601</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Hoje vamos aprender como configurar o ambiente no MacOS para começar a desenvolver com Phone Gap &#8211; agora conhecido como Cordova com o Xcode.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegapcordovalogo.png"><img class="aligncenter size-full wp-image-4614" title="phonegapcordovalogo" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegapcordovalogo.png" alt="" width="217" height="116" /></a></p>
<h2><em><strong>Requisitos</strong></em>:</h2>
<ul>
<li><a href="http://developer.apple.com/" target="_blank">XCode</a> (MacOS)</li>
<li><a href="http://phonegap.com/download" target="_blank">Phone Gap SDK</a></li>
</ul>
<h2>Passo a passo:</h2>
<ol>
<li>Instalar o plugin do Cordova no XCode</li>
<li>Criar uma aplicação</li>
<li>Implementar o Hello World</li>
<li>Executar no Emulador iOS</li>
<li>Próximos Passos</li>
</ol>
<h1>1 &#8211; Instalando o Plugin do Cordova (Phone Gap no XCode)</h1>
<p>1.1 &#8211; Depois de fazer o download do Phone Gap (Cordova) no site, unzipe o arquivo e faça a instalação do arquivo dmg que se encontra dentro do diretório iOS &#8211; deixe o XCode fechado enquanto faz essa instalação.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-01.png"><img class="aligncenter size-full wp-image-4611" title="phonegap-cordova-helloworld-loiane-01" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-01.png" alt="" width="566" height="538" /></a></p>
<h1>2 &#8211; Criando uma Aplicação no XCode</h1>
<p>2.1 &#8211; Abra o XCode e selecione criar um novo projeto. Selecione &#8220;Cordova based application&#8221; e clique em &#8220;Next&#8221;:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-02.png"><img class="aligncenter  wp-image-4612" title="phonegap-cordova-helloworld-loiane-02" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-02.png" alt="" width="587" height="395" /></a></p>
<p>2.2 &#8211; Dê um nome para o seu projeto e entre com um identificador da sua empresa. Desmarque a opção Use Automatic Reference Counting também:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-031.png"><img class="aligncenter  wp-image-4615" title="phonegap-cordova-helloworld-loiane-03" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-031.png" alt="" width="583" height="393" /></a></p>
<p>2.3 &#8211; Escolha um diretório e salve o seu projeto. O XCode irá abrir o projeto.</p>
<h1>3 &#8211; Hello World</h1>
<p>3.1 &#8211; Vamos tentar executar o projeto para ver o que acontece:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-04.png"><img class="aligncenter" title="phonegap-cordova-helloworld-loiane-04" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-04.png" alt="" width="430" height="474" /></a></p>
<p>3.2 &#8211; O seguinte erro deverá aparecer no simulador:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-05.png"><img class="aligncenter" title="phonegap-cordova-helloworld-loiane-05" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-05.png" alt="" width="396" height="744" /></a></p>
<p>3.3 &#8211; Clique com o botão direito no projeto e escolha &#8220;Show in Finder&#8221;:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-06.png"><img class="aligncenter size-full wp-image-4618" title="phonegap-cordova-helloworld-loiane-06" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-06.png" alt="" width="452" height="383" /></a></p>
<p>3.4 &#8211; Você irá ver uma pasta chamada &#8220;www&#8221;. Clique e arraste essa pasta para dentro do projeto:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-07.png" target="_blank"><img class="aligncenter  wp-image-4619" title="phonegap-cordova-helloworld-loiane-07" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-07.png" alt="" width="577" height="418" /></a></p>
<p>3.5 &#8211; Depois que soltar a pasta dentro do diretório, uma janela de configuração irá se abrir: Marque as seguintes opções:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-08.png"><img class="aligncenter  wp-image-4621" title="phonegap-cordova-helloworld-loiane-08" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-08.png" alt="" width="584" height="392" /></a></p>
<h1>4 &#8211; Executando a Aplicação no Emulador iOS</h1>
<p>4.1 &#8211; Vamos executar o projeto novamente, e este deve ser o resultado:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-09.png"><img class="aligncenter size-full wp-image-4622" title="phonegap-cordova-helloworld-loiane-09" src="http://www.loiane.com/wp-content/uploads/2012/05/phonegap-cordova-helloworld-loiane-09.png" alt="" width="396" height="744" /></a></p>
<h1>5 &#8211; Próximos Passos</h1>
<p>Agora basta estudar a API e soltar a criatividade!</p>
<p>Até a próxima!</p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4601&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/viFFxIYSHovdA3Cp6qnhAB1Z7lg/0/da"><img src="http://feedads.g.doubleclick.net/~a/viFFxIYSHovdA3Cp6qnhAB1Z7lg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/viFFxIYSHovdA3Cp6qnhAB1Z7lg/1/da"><img src="http://feedads.g.doubleclick.net/~a/viFFxIYSHovdA3Cp6qnhAB1Z7lg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=YlnUZv7vz0U:EyS88sOwn94:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=YlnUZv7vz0U:EyS88sOwn94:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=YlnUZv7vz0U:EyS88sOwn94:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/YlnUZv7vz0U" height="1" width="1"/>]]></content:encoded><description>Hoje vamos aprender como configurar o ambiente no MacOS para começar a desenvolver com Phone Gap &amp;#8211; agora conhecido como Cordova com o Xcode. Requisitos: XCode (MacOS) Phone Gap SDK Passo a passo: Instalar o plugin do Cordova no XCode Criar uma aplicação Implementar o Hello World Executar no Emulador iOS Próximos Passos 1 &amp;#8211; [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/comecando-com-phone-gap-cordova-hello-word-ios/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/comecando-com-phone-gap-cordova-hello-word-ios/</feedburner:origLink></item><item><title>Começando com Sencha Touch 2: Hello World (iOS e Android)</title><link>http://feedproxy.google.com/~r/Loiane/~3/hBcEoZeaxqI/</link><category>Sencha Touch 2</category><category>Android</category><category>iOS</category><category>mobile</category><category>Sencha</category><category>Sencha Touch</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Wed, 16 May 2012 00:30:52 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4565</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Neste post vamos aprender como criar uma aplicação base para começarmos a desenvolver com Sencha Touch 2, um framework JavaScript para desenvolvimento de aplicações mobile (iOS, Android e Blackberry) nativas.</p>
<p>Se você não sabe o que é Sencha Touch e ficou curioso, pode assistir a <a title="Curso Sencha Touch 2" href="http://www.loiane.com/2012/03/curso-de-sencha-touch-2-gratuito/" target="_blank">primeira video-aula do curso de Sencha Touch 2</a>, onde faço um overview completo da tecnologia.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha_touch_slide.png"><img class="aligncenter size-full wp-image-4574" title="sencha_touch_slide" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha_touch_slide.png" alt="" width="550" height="320" /></a></p>
<p><strong>Requisitos:</strong></p>
<ul>
<li><a href="http://www.sencha.com/products/touch/download/" target="_blank">Sencha Touch 2 SDK</a></li>
<li><a href="http://www.sencha.com/products/sdk-tools/download" target="_blank">Sencha SDK Tools</a></li>
<li>Browser (Chrome)</li>
<li>Terminal &#8211; console</li>
<li>Editor de texto</li>
<li>Emulador mobile &#8211; iOS ou Android</li>
</ul>
<p><strong>Passo a passo desse tutorial:</strong></p>
<ol>
<li>Download do SDK</li>
<li>Criar o projeto</li>
<li>Fazer build</li>
<li>Usando o Emulador iOS</li>
<li>Usando o Emulador Android</li>
<li>Próximos Passos</li>
</ol>
<h1>1 &#8211; Instalando o SDK e ferramentas necessárias</h1>
<p>O primeiro passo é fazer o download do SDK do Sencha Touch 2 e do <a href="http://www.sencha.com/products/sdk-tools/download" target="_blank">SDK tools</a>. Vamos primeiro instalar o SDK Tools:</p>
<p>1.1 &#8211; Vá até <a href="http://www.sencha.com/products/sdk-tools/download" target="_blank">http://www.sencha.com/products/sdk-tools/download </a>e faça o download para versão do seu sistema operacional.</p>
<p>1.2 &#8211; Instale do SDK Tools &#8211; basta seguir o next-next-finish:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha-sdk-tools-loiane.png"><img class="aligncenter  wp-image-4576" title="sencha-sdk-tools-loiane" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha-sdk-tools-loiane.png" alt="" width="553" height="446" /></a></p>
<p style="text-align: left;">1.3 &#8211; Vá até <a href="http://www.sencha.com/products/touch/download/" target="_blank">http://www.sencha.com/products/touch/download/</a> e faça download da versão Open Source. Depois que o download terminar, basta unzipar o arquivo em um servidor web (apache, por exemplo). É necessário que seja possível acessar o Sencha Touch através de um endereço local, como por exemplo <em>http://localhost/sencha-touch-2.0.1</em>. Para entender mais sobre isso, você pode assistir a <a title="[Curso de Sencha Touch 2] Aula 02: Instalação e Hello World" href="http://www.loiane.com/2012/05/curso-de-sencha-touch-2-aula-02-instalacao-e-hello-world/" target="_blank">aula 2 do Curso Gratuito de Sencha Touch 2</a>.</p>
<h1>2 &#8211; Criando o Projeto</h1>
<p>Agora que já temos tudo instalado, vamos criar o nosso primeiro projeto. Recebo muitos emails perguntando como crio as minhas aplicações, e vou descrever para vocês agora.</p>
<p>2.1 &#8211; Eu fiz o deploy do SDK do Sencha Touch no meu servidor Apache que já vem no Mac. Mas você também pode usar o Mamp, Xampp, .</p>
<p>O diretório que o meu SDK está instalado é: <em>/Users/loiane/Projects/sencha-touch-2.0.1</em></p>
<p>2.2 &#8211; Para criar o projeto precisamos abrir o terminar e navegar até o diretório onde o ST2 está instalado:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-011.png"><img class="aligncenter  wp-image-4580" title="sencha-touch-2-helloworld-loiane-01" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-011.png" alt="" width="543" height="336" /></a></p>
<p>2.3 &#8211; Agora vamos usar o comando sencha generate app para gerar a base da aplicação. Para usarmos esse comando, precisamos passar mais 2 argumentos, sendo o primeiro o nome do namespace da nossa aplicação e o segundo o diretório onde será criada a aplicação. Vou criar uma aplicação com namespace STHelloWorld no diretório  <em>/Users/loiane/Projects/touch2-hello-world. </em>Sendo assim, preciso digitar o comando <strong><em>sencha</em></strong> <strong><em>generate app STHelloWorld ../touch2-hello-world</em></strong>:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-03.png" target="_blank"><img class="aligncenter  wp-image-4579" title="sencha-touch-2-helloworld-loiane-03" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-03.png" alt="" width="543" height="336" /></a></p>
<p>2.4 &#8211; Como vocês podem ver, o SDK Tools gerou a aplicação completa no diretório:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-04.png"><img class="aligncenter size-full wp-image-4581" title="sencha-touch-2-helloworld-loiane-04" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-04.png" alt="" width="566" height="369" /></a></p>
<p>2.5 &#8211; Se abrirmos o diretório da aplicação, veremos que a aplicação gerada contém tudo o que precisamos: a estrutura MVC, todos os arquivos da aplicação e o sdk do touch 2 incluso.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-05.png"><img class="aligncenter size-full wp-image-4582" title="sencha-touch-2-helloworld-loiane-05" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-05.png" alt="" width="566" height="730" /></a></p>
<p>2.6 &#8211; Se acessarmos a aplicação no Google Chromes, por exemplo, teremos a seguinte resultado:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-06.png"><img class="aligncenter size-full wp-image-4583" title="sencha-touch-2-helloworld-loiane-06" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-06.png" alt="" width="524" height="638" /></a></p>
<p>Pronto, a aplicação está pronta e você já pode começar a modificar e criar sua aplicação em cima dessa que criamos.</p>
<h1>3 &#8211; Usando o Emulador iOS</h1>
<p>3.1 &#8211; Bem até agora testamos apenas no browser. Isso é legal porque não precisamos fazer o build para um emulador toda vez que a gente mudar alguma coisa; podemos testar primeiro no browser e no final, quando estiver da maneira desejada, podemos fazer o build e testar em um emulador, antes de empacotar a nossa app ST2 para uma app iOS ou Android.</p>
<p>Note que na aplicação existe um arquivo chamado <span style="text-decoration: underline;"><em><strong>packager.json</strong></em></span> onde vamos editar as configurações para ver a aplicação funcionando em um emulador. A parte mais importante se quisermos executar é a configuração <span style="text-decoration: underline;"><em><strong>platform</strong></em></span>. Por padrão, já vem configurado para o iOS Emulator.</p>
<p>Para testarmos a aplicação no iOS Emulator (precisa ter o XCode instalado, se você usa MacOS), basta executar o seguinte comando: <strong>sencha app build native:</strong></p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-07.png" target="_blank"><img class="aligncenter  wp-image-4584" title="sencha-touch-2-helloworld-loiane-07" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-07.png" alt="" width="543" height="385" /></a></p>
<p style="text-align: left;">3.2 &#8211; Quando o SDK Tools terminar de construir a aplicação, o iOS Emulator irá abrir e podermos navegar na aplicação:</p>
<p style="text-align: left;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-08.png"><img class="aligncenter size-full wp-image-4585" title="sencha-touch-2-helloworld-loiane-08" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-08.png" alt="" width="396" height="744" /></a></p>
<h1>4 - Usando o Emulador Android</h1>
<p>4.1 &#8211; Para usar o Android Emulator, precisamos ter o SDK do Android instalado na máquina. Caso você não tenha, vá até <a href="http://developer.android.com/sdk/index.html" target="_blank">http://developer.android.com/sdk/index.html</a> e faça o download e configure no seu sistema operacional.</p>
<p>4.2 &#8211; Abra o arquivo <em><strong>packager.json </strong></em>e configure as seguintes opções:</p>
<ul>
<li>&#8220;platform&#8221;:&#8221;AndroidEmulator&#8221;,</li>
<li>&#8220;sdkPath&#8221;:&#8221;/Users/loiane/Documents/development/android-sdk-macosx&#8221;, (configure o caminho do SDK do Android no seu sistema operacional)</li>
<li>&#8220;androidAPILevel&#8221;:&#8221;15&#8243;,</li>
</ul>
<div>4.3 &#8211; Inicie o emulador Android correspondente ao API Level que configurou no arquivo packager.json</div>
<div></div>
<div>4.4 &#8211; Execute o comando <strong>sencha app build native </strong>novamente e a aplicação será carregada no emulador Android:</div>
<div></div>
<div><a href="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-09.png" target="_blank"><img class="aligncenter  wp-image-4594" title="sencha-touch-2-helloworld-loiane-09" src="http://www.loiane.com/wp-content/uploads/2012/05/sencha-touch-2-helloworld-loiane-09.png" alt="" width="574" height="535" /></a></div>
<h1>5 &#8211; Próximos Passos</h1>
<p>Agora é só deixar a imaginação e criatividade fluir e criar lindas apps com ST2!</p>
<ul>
<li>Leia os guides da documentação: <a href="http://docs.sencha.com/touch/2-0/" target="_blank">http://docs.sencha.com/touch/2-0/</a></li>
<li>Veja alguns exemplos: <a href="http://docs.sencha.com/touch/2-0/#!/example" target="_blank">http://docs.sencha.com/touch/2-0/#!/example</a></li>
<li>Curso Online Gratuito: <a href="http://www.loiane.com/2012/03/curso-de-sencha-touch-2-gratuito/" target="_blank">http://www.loiane.com/2012/03/curso-de-sencha-touch-2-gratuito/</a></li>
</ul>
<p>Até a próxima! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4565&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/FQtR2vltg_GY8DBYnozu1foVGf8/0/da"><img src="http://feedads.g.doubleclick.net/~a/FQtR2vltg_GY8DBYnozu1foVGf8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/FQtR2vltg_GY8DBYnozu1foVGf8/1/da"><img src="http://feedads.g.doubleclick.net/~a/FQtR2vltg_GY8DBYnozu1foVGf8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=hBcEoZeaxqI:F6kTeZZSHjY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=hBcEoZeaxqI:F6kTeZZSHjY:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=hBcEoZeaxqI:F6kTeZZSHjY:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/hBcEoZeaxqI" height="1" width="1"/>]]></content:encoded><description>Neste post vamos aprender como criar uma aplicação base para começarmos a desenvolver com Sencha Touch 2, um framework JavaScript para desenvolvimento de aplicações mobile (iOS, Android e Blackberry) nativas. Se você não sabe o que é Sencha Touch e ficou curioso, pode assistir a primeira video-aula do curso de Sencha Touch 2, onde faço [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/comecando-com-sencha-touch-2-hello-world-ios-e-android/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/comecando-com-sencha-touch-2-hello-world-ios-e-android/</feedburner:origLink></item><item><title>ExtJS 4 MVC: Ajax CRUD Grid com PHP e MySQL – JSON</title><link>http://feedproxy.google.com/~r/Loiane/~3/ws9kT2GQti0/</link><category>Ext JS 4</category><category>AJAX</category><category>CRUD</category><category>ExtJS 4</category><category>ExtJS 4 MVC</category><category>JSON</category><category>MySQL</category><category>php</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Tue, 15 May 2012 00:30:45 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4365</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Ei pessoal,</p>
<p>Mais um exemplo sobre ExtJS 4 MVC aqui no  blog.</p>
<p>Este provavavelmente é o post mais pedido sobre ExtJS 4 MVC. Um exemplo de como começar uma aplicação MVC com PHP e MySQL.</p>
<h3>Screenshot da aplicação:</h3>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/05/extjs4-mvc-json-crud-php-mysql-loiane.png"><img class="aligncenter size-full wp-image-4561" title="extjs4-mvc-json-crud-php-mysql-loiane" src="http://www.loiane.com/wp-content/uploads/2012/05/extjs4-mvc-json-crud-php-mysql-loiane.png" alt="" width="513" height="417" /></a></p>
<h3>Estrutura do Projeto:</h3>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-json-crud-php-mysql1.png"><img class="aligncenter size-full wp-image-4521" title="extjs4-mvc-json-crud-php-mysql" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-json-crud-php-mysql1.png" alt="" width="566" height="728" /></a></p>
<h3>Código Fonte:</h3>
<p>Como o exemplo é bem grande e tem bastante código fonte, não vou postar aqui no blog. Quem tiver interesse pode pegar o código completo no meu github: <a href="https://github.com/loiane/extjs4-mvc-json-crud-php-mysql" target="_blank">https://github.com/loiane/extjs4-mvc-json-crud-php-mysql</a></p>
<h3>Demo:</h3>
<p>Quem tiver interesse, também pode ver o exemplo live: <a href="http://loiane.com/extjs/extjs4-mvc-json-crud-php-mysql" target="_blank">http://loiane.com/extjs/extjs4-mvc-json-crud-php-mysql</a></p>
<h3>ScreenCast passo a passo:</h3>
<p>Em breve vou gravar um screencast ensinando a fazer passo a passo esse exemplo também.</p>
<p>Até a próxima! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4365&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/BRDq8L1KJ1h0G0hX_YeZ4dWwCck/0/da"><img src="http://feedads.g.doubleclick.net/~a/BRDq8L1KJ1h0G0hX_YeZ4dWwCck/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/BRDq8L1KJ1h0G0hX_YeZ4dWwCck/1/da"><img src="http://feedads.g.doubleclick.net/~a/BRDq8L1KJ1h0G0hX_YeZ4dWwCck/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=ws9kT2GQti0:F8kHmTrMjDQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=ws9kT2GQti0:F8kHmTrMjDQ:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=ws9kT2GQti0:F8kHmTrMjDQ:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/ws9kT2GQti0" height="1" width="1"/>]]></content:encoded><description>Ei pessoal, Mais um exemplo sobre ExtJS 4 MVC aqui no  blog. Este provavavelmente é o post mais pedido sobre ExtJS 4 MVC. Um exemplo de como começar uma aplicação MVC com PHP e MySQL. Screenshot da aplicação: Estrutura do Projeto: Código Fonte: Como o exemplo é bem grande e tem bastante código fonte, não [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/extjs-4-mvc-ajax-crud-grid-com-php-e-mysql-json/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/extjs-4-mvc-ajax-crud-grid-com-php-e-mysql-json/</feedburner:origLink></item><item><title>Exemplo ExtJS 4 MVC: Complex DashBoard (Grid, Form e Gráficos)</title><link>http://feedproxy.google.com/~r/Loiane/~3/kwtS6OxnV9Y/</link><category>Ext JS 4</category><category>ExtJS 4</category><category>ExtJS 4 MVC</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Mon, 14 May 2012 00:30:43 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4487</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo <a href="http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/charts/FormDashboard.html" target="_blank">Complex Dashboard</a>.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/05/extjs4-mvc-complex-dashboard-loiane.png" target="_blank"><img class="aligncenter  wp-image-4553" title="extjs4-mvc-complex-dashboard-loiane" src="http://www.loiane.com/wp-content/uploads/2012/05/extjs4-mvc-complex-dashboard-loiane.png" alt="" width="556" height="459" /></a></p>
<p>Vamos lá!</p>
<h2>Estrutura do Projeto:</h2>
<p><img class="aligncenter size-full wp-image-4488" title="extjs4-mvc-complex-dashboard" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-complex-dashboard.png" alt="" width="566" height="578" /></p>
<h2>Model &#8211; Stock</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.Stock', {
	extend: 'Ext.data.Model',
	fields: [
	    {name: 'company'},
        {name: 'price',   type: 'float'},
        {name: 'revenue %', type: 'float'},
        {name: 'growth %',  type: 'float'},
        {name: 'product %', type: 'float'},
        {name: 'market %',  type: 'float'}
    ]
});
</pre>
<h2>Model &#8211; RadarDataSet</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.RadarDataSet', {
	extend: 'Ext.data.Model',
	fields: ['Name', 'Data']
});
</pre>
<h2>Store - Stock</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.store.Stocks', {
    extend: 'Ext.data.ArrayStore',
    model: 'ExtMVC.model.Stock'
});
</pre>
<h2>Store - RadarDataSet</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.store.RadarDataSets', {
    extend: 'Ext.data.ArrayStore',
    model: 'ExtMVC.model.RadarDataSet',

    proxy: {
        type: 'memory',
        reader: {
            type: 'json'
        }
    },

    data: [
    {
        'Name': 'Price',
        'Data': 100
    }, {
        'Name': 'Revenue %',
        'Data': 100
    }, {
        'Name': 'Growth %',
        'Data': 100
    }, {
        'Name': 'Product %',
        'Data': 100
    }, {
        'Name': 'Market %',
        'Data': 100
    }]
});
</pre>
<h2>View &#8211; chart &#8211; StockBar</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.chart.StockBar', {
	extend: 'Ext.chart.Chart',
    alias : 'widget.stockbar',

	flex: 1,
    shadow: true,
    animate: true,
    store: 'Stocks',
    axes: [{
        type: 'Numeric',
        position: 'left',
        fields: ['price'],
        minimum: 0,
        hidden: true
    }, {
        type: 'Category',
        position: 'bottom',
        fields: ['company'],
        label: {
            renderer: function(v) {
                return Ext.String.ellipsis(v, 15, false);
            },
            font: '9px Arial',
            rotate: {
                degrees: 270
            }
        }
    }],
    series: [{
        type: 'column',
        axis: 'left',
        highlight: true,
        style: {
            fill: '#456d9f'
        },
        highlightCfg: {
            fill: '#a2b5ca'
        },
        label: {
            contrast: true,
            display: 'insideEnd',
            field: 'price',
            color: '#000',
            orientation: 'vertical',
            'text-anchor': 'middle'
        },
        xField: 'name',
        yField: ['price']
    }]
});
</pre>
<h2>View &#8211; chart &#8211; StockRadar</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.chart.StockRadar', {
	extend: 'Ext.chart.Chart',
    alias : 'widget.stockradar',

	margin: '0 0 0 0',
    insetPadding: 20,
    flex: 1.2,
    animate: true,
    store: 'RadarDataSets',
    theme: 'Blue',
    axes: [{
        steps: 5,
        type: 'Radial',
        position: 'radial',
        maximum: 100
    }],
    series: [{
        type: 'radar',
        xField: 'Name',
        yField: 'Data',
        showInLegend: false,
        showMarkers: true,
        markerConfig: {
            radius: 4,
            size: 4,
            fill: 'rgb(69,109,159)'
        },
        style: {
            fill: 'rgb(194,214,240)',
            opacity: 0.5,
            'stroke-width': 0.5
        }
    }]
});
</pre>
<h2>View &#8211; stocks- StockGrid</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.stocks.StockGrid', {
	extend: 'Ext.grid.Panel',
	alias : 'widget.stockgrid',

	id: 'company-form',
    flex: 0.60,
    store: 'Stocks',
    title:'Company Data',

    perc: function(v) {
        return v + '%';
    },

    initComponent: function() {

	    this.columns= [
	        {
	            id       :'company',
	            text   : 'Company',
	            flex: 1,
	            sortable : true,
	            dataIndex: 'company'
	        },
	        {
	            text   : 'Price',
	            width    : 75,
	            sortable : true,
	            dataIndex: 'price',
	            align: 'right',
	            renderer : 'usMoney'
	        },
	        {
	            text   : 'Revenue',
	            width    : 75,
	            sortable : true,
	            align: 'right',
	            dataIndex: 'revenue %',
	            renderer: this.perc
	        },
	        {
	            text   : 'Growth',
	            width    : 75,
	            sortable : true,
	            align: 'right',
	            dataIndex: 'growth %',
	            renderer: this.perc
	        },
	        {
	            text   : 'Product',
	            width    : 75,
	            sortable : true,
	            align: 'right',
	            dataIndex: 'product %',
	            renderer: this.perc
	        },
	        {
	            text   : 'Market',
	            width    : 75,
	            sortable : true,
	            align: 'right',
	            dataIndex: 'market %',
	            renderer: this.perc
	        }
	    ];

		this.callParent(arguments);
    }
});
</pre>
<h2>View &#8211; stocks- StockForm</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.stocks.StockForm', {
	extend: 'Ext.form.Panel',
	alias : 'widget.stockform',

	requires: [
		'ExtMVC.view.stocks.StockGrid',
		'ExtMVC.view.chart.StockBar',
		'ExtMVC.view.chart.StockRadar'
	],

	title: 'Company data',
    frame: true,
    bodyPadding: 5,
    //width: 870,
    //height: 720,

    fieldDefaults: {
        labelAlign: 'left',
        msgTarget: 'side'
    },

    layout: {
        type: 'vbox',
        align: 'stretch'
    },

    items: [
        {
            height: 200,
            layout: 'fit',
            margin: '0 0 3 0',
            items: [{ xtype: 'stockbar'}]
        },
        {

        layout: {type: 'hbox', align: 'stretch'},
        flex: 3,
        border: false,
        bodyStyle: 'background-color: transparent',

        items: [{
        	xtype: 'stockgrid'
        }, {
            flex: 0.4,
            layout: {
                type: 'vbox',
                align:'stretch'
            },
            margin: '0 0 0 5',
            title: 'Company Details',
            items: [{
                margin: '5',
                xtype: 'fieldset',
                flex: 1,
                title:'Company details',
                defaults: {
                    width: 240,
                    labelWidth: 90,
                    disabled: true
                },
                defaultType: 'numberfield',
                items: [{
                    fieldLabel: 'Name',
                    name: 'company',
                    xtype: 'textfield'
                },{
                    fieldLabel: 'Price',
                    name: 'price',
                    maxValue: 100,
                    minValue: 0,
                    enforceMaxLength: true,
                    maxLength: 5
                },{
                    fieldLabel: 'Revenue %',
                    name: 'revenue %',
                    maxValue: 100,
                    minValue: 0,
                    enforceMaxLength: true,
                    maxLength: 5
                },{
                    fieldLabel: 'Growth %',
                    name: 'growth %',
                    maxValue: 100,
                    minValue: 0,
                    enforceMaxLength: true,
                    maxLength: 5
                },{
                    fieldLabel: 'Product %',
                    name: 'product %',
                    maxValue: 100,
                    minValue: 0,
                    enforceMaxLength: true,
                    maxLength: 5
                },{
                    fieldLabel: 'Market %',
                    name: 'market %',
                    maxValue: 100,
                    minValue: 0,
                    enforceMaxLength: true,
                    maxLength: 5
                }]
            }, {xtype:'stockradar'}]
        }]
    }]
});
</pre>
<h2>ViewPort</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
/**
 * The main application viewport, which displays the whole application
 * @extends Ext.Viewport
 */
Ext.define('ExtMVC.view.Viewport', {
    extend: 'Ext.Viewport',

    layout: 'fit',

    requires: [
        'ExtMVC.view.stocks.StockForm',
        'ExtMVC.view.stocks.StockGrid',
        'ExtMVC.view.chart.StockBar',
        'ExtMVC.view.chart.StockRadar'
    ],

    initComponent: function() {
        var me = this;

        Ext.apply(me, {
            items: [
                {
                    xtype: 'stockform'
                }
            ]
        });

        me.callParent(arguments);
    }
});
</pre>
<h2>Controller</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.controller.Stocks', {
    extend: 'Ext.app.Controller',

    models: ['Stock','RadarDataSet'],

   	stores: ['Stocks', 'RadarDataSets'],

    views: [
        'chart.StockRadar',
        'chart.StockBar',
        'stocks.StockGrid',
        'stocks.StockForm'
    ],

    refs: [{
        ref: 'stockForm',
        selector: 'form'
    },{
        ref: 'stockGrid',
        selector: 'grid'
    }],

    init: function() {

        this.loadStore();

        this.control({
        	'stockgrid': {
        		selectionchange: this.selectionchange
        	}/*,
            'textfield': {
                change: this.changeField
            }*/,
            'numberfield': {
                change: this.changeField
            },
            'stockbar': {
                afterrender: function (chart,o) {

                    var series = chart.series.getAt(0);
                    series.listeners = {
                        itemmouseup: function(item) {

                            var series = Ext.ComponentQuery.query('stockbar')[0].series.get(0);
                            var index = Ext.Array.indexOf(series.items, item);
                            var selectionModel = Ext.ComponentQuery.query('grid')[0].getSelectionModel();

                            var selectedStoreItem = item.storeItem;
                            selectionModel.select(index);
                        }
                    }
                },
                beforerefresh: this.beforerefresh
            }
        });
    },

    loadStore: function(){

        var store = this.getStocksStore();

        // sample static data for the store
        var myData = [
            ['3m Co'],
            ['Alcoa Inc'],
            ['Altria Group Inc'],
            ['American Express Company'],
            ['American International Group, Inc.'],
            ['AT&amp;T Inc'],
            ['Boeing Co.'],
            ['Caterpillar Inc.'],
            ['Citigroup, Inc.'],
            ['E.I. du Pont de Nemours and Company'],
            ['Exxon Mobil Corp'],
            ['General Electric Company'],
            ['General Motors Corporation'],
            ['Hewlett-Packard Co'],
            ['Honeywell Intl Inc'],
            ['Intel Corporation'],
            ['International Business Machines'],
            ['Johnson &amp; Johnson'],
            ['JP Morgan &amp; Chase &amp; Co'],
            ['McDonald\'s Corporation'],
            ['Merck &amp; Co., Inc.'],
            ['Microsoft Corporation'],
            ['Pfizer Inc'],
            ['The Coca-Cola Company'],
            ['The Home Depot, Inc.'],
            ['The Procter &amp; Gamble Company'],
            ['United Technologies Corporation'],
            ['Verizon Communications'],
            ['Wal-Mart Stores, Inc.']
        ];

        for (var i = 0, l = myData.length, rand = Math.random; i &lt; l; i++) {
            var data = myData[i];
            data[1] = ((rand() * 10000) &gt;&gt; 0) / 100;
            data[2] = ((rand() * 10000) &gt;&gt; 0) / 100;
            data[3] = ((rand() * 10000) &gt;&gt; 0) / 100;
            data[4] = ((rand() * 10000) &gt;&gt; 0) / 100;
            data[5] = ((rand() * 10000) &gt;&gt; 0) / 100;
        }

        store.loadData(myData);
    },

    selectionchange: function(model, records){

        var json, name, i, l, items, series, fields;

        var form = this.getStockForm().getForm();

        if (records[0]) {
            rec = records[0];

            if (!form) {
                form = this.getStockForm().getForm();
                fields = form.getFields();
                fields.each(function(field){
                    if (field.name != 'company') {
                        field.setDisabled(false);
                    }
                });
            } else {
                fields = form.getFields();
            }

            // prevent change events from firing
            fields.each(function(field){
                field.suspendEvents();
                console.log('suspended');
            });
            form.loadRecord(rec);
            this.updateRecord(rec);

            fields.each(function(field){
                field.resumeEvents();
            });

            fields.each(function(field){
                if (field.name != 'company') {
                    field.setDisabled(false);
                }
            });
        }
    },

    updateRecord: function(rec) {
        var name, series, i, l, items, json = [{
            'Name': 'Price',
            'Data': rec.get('price')
        }, {
            'Name': 'Revenue %',
            'Data': rec.get('revenue %')
        }, {
            'Name': 'Growth %',
            'Data': rec.get('growth %')
        }, {
            'Name': 'Product %',
            'Data': rec.get('product %')
        }, {
            'Name': 'Market %',
            'Data': rec.get('market %')
        }];

        var store = this.getRadarDataSetsStore();
        store.loadData(json);
        this.selectItem(rec);
    },

    selectItem: function(storeItem) {

        var name = storeItem.data.company;//storeItem.get('company'),
        var series = Ext.ComponentQuery.query('stockbar')[0].series.get(0);
        var i, items, l;

        series.highlight = true;
        series.unHighlightItem();
        series.cleanHighlights();
        for (i = 0, items = series.items, l = items.length; i &lt; l; i++) {
            if (name == items[i].storeItem.get('company')) {
                selectedStoreItem = items[i].storeItem;
                series.highlightItem(items[i]);
                break;
            }
        }
        series.highlight = false;
    },

    changeField: function(field, newValue, oldValue) {

        console.log('changeField');

        var form = this.getStockForm().getForm();
        var rec = this.getStockGrid().getSelectionModel().getSelection()[0];

        if (rec &amp;&amp; form) {
            if (newValue &gt; field.maxValue) {
                field.setValue(field.maxValue);
            } else {
                form.updateRecord(rec);
                this.updateRecord(rec);
            }
        }
    },

    beforerefresh: function() {
        var timer = false;

        return function() {
            clearTimeout(timer);

            var series = Ext.ComponentQuery.query('stockbar')[0].series.get(0);
            var index = Ext.Array.indexOf(series.items, item);
            var selectionModel = Ext.ComponentQuery.query('grid')[0].getSelectionModel();
            var selectedStoreItem = item.storeItem;

            if (selectedStoreItem) {
                timer = setTimeout(function() {
                    this.selectItem(selectedStoreItem);
                }, 900);
            }
        };
    }
});
</pre>
<h2>App</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', 'app/ux');

/*
 * BUG: suspentEvents not honoured in Ext.app.EventBus
 *
 * note: this fix does not queue events when asked.
 *
 * http://www.sencha.com/forum/showthread.php?171525
 */
Ext.syncRequire('Ext.app.EventBus');
Ext.override(Ext.app.EventBus, {
    constructor: function() {
        this.mixins.observable.constructor.call(this);

        this.bus = {};

        var me = this;
        Ext.override(Ext.Component, {
            fireEvent: function(ev) {
// [
// --
//              if (Ext.util.Observable.prototype.fireEvent.apply(this, arguments) !== false) {
// ++
                if (Ext.util.Observable.prototype.fireEvent.apply(this, arguments) !== false &amp;&amp; !this.eventsSuspended) {
// ]
                    return me.dispatch.call(me, ev, this, arguments);
                }
                return false;
            }
        });
    }
});

Ext.application({
    name: 'ExtMVC',

    controllers: [
        'Stocks'
    ],

    autoCreateViewport: true
});
</pre>
<h2>Página HTML</h2>
<pre class="brush: xml; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Ext JS 4 MVC Examples - loiane.com&lt;/title&gt;
    &lt;!-- Ext JS Files --&gt;
    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;extjs/resources/css/ext-all.css&quot;&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;extjs/ext-all-debug.js&quot;&gt;&lt;/script&gt;

    &lt;!-- App Files --&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>Download do Código Fonte:</h2>
<p>Você pode fazer o download do código fonte completo no meu repositório do github: <a href="https://github.com/loiane/extjs4-mvc-complex-dashboard" target="_blank">https://github.com/loiane/extjs4-mvc-complex-dashboard</a></p>
<h2>Demo:</h2>
<p>Exemplo funcionando: <a href="http://loiane.com/extjs/extjs4-mvc-complex-dashboard" target="_blank">http://loiane.com/extjs/extjs4-mvc-complex-dashboard</a></p>
<h3>Todos os exemplos ExtJS 4 MVC:</h3>
<p><a href="http://www.loiane.com/2012/03/exemplos-sencha-extjs-4-em-mvc/" target="_blank">http://www.loiane.com/2012/03/exemplos-sencha-extjs-4-em-mvc/</a></p>
<p>Até o próximo exemplo! <img src="http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4487&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/Y9uXAKK7-1LDw9SllUXggBOLIn4/0/da"><img src="http://feedads.g.doubleclick.net/~a/Y9uXAKK7-1LDw9SllUXggBOLIn4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Y9uXAKK7-1LDw9SllUXggBOLIn4/1/da"><img src="http://feedads.g.doubleclick.net/~a/Y9uXAKK7-1LDw9SllUXggBOLIn4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=kwtS6OxnV9Y:06aLGkZ3pVo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=kwtS6OxnV9Y:06aLGkZ3pVo:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=kwtS6OxnV9Y:06aLGkZ3pVo:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/kwtS6OxnV9Y" height="1" width="1"/>]]></content:encoded><description>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo Complex Dashboard. Vamos lá! Estrutura do Projeto: Model &amp;#8211; Stock Model &amp;#8211; RadarDataSet Store - Stock Store - RadarDataSet View &amp;#8211; chart &amp;#8211; StockBar View &amp;#8211; chart &amp;#8211; StockRadar View &amp;#8211; stocks- StockGrid View &amp;#8211; stocks- StockForm ViewPort Controller App [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/exemplo-extjs-4-mvc-complex-dashboard-grid-form-e-graficos/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/exemplo-extjs-4-mvc-complex-dashboard-grid-form-e-graficos/</feedburner:origLink></item><item><title>[Curso de ExtJS 4] Aula 25: MessageBox: Dialog</title><link>http://feedproxy.google.com/~r/Loiane/~3/raZrWCqLJ2s/</link><category>Curso ExtJS 4</category><category>ExtJS</category><category>ExtJS 4</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Wed, 09 May 2012 00:30:00 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4329</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Vídeo/Screencast de hoje: aula 25 do curso gratuito de Ext JS 4!</p>
<p>Na aula de hoje vamos aprender como usar o MessageBox, aquela janela de alert. Vamos aprender todos os tipos de dialogs que podemos fazer com ExtJS, inclusive os customizados.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/curso-extjs4-aula25-loiane.png"><img class="aligncenter  wp-image-4505" title="curso-extjs4-aula25-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/curso-extjs4-aula25-loiane.png" alt="" width="488" height="370" /></a></p>
<p>Quem quiser ver todas as aulas já publicadas, é só <a href="http://wp.me/pCF9v-Ob" target="_blank">clicar aqui</a>.</p>
<p>Espero que gostem dessa aula e fico no aguardo do feedback de vocês! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em><strong>Requerimentos:</strong></em></p>
<ul>
<li><a href="http://www.sencha.com/products/extjs/download/" target="_blank">Ext JS 4 SDK</a></li>
<li>Servidor Apache (opcional).</li>
<li>Editor de Texto (qualquer um de sua preferência). No vídeo usei o <a href="http://www.sublimetext.com/2" target="_blank">Sublime Text 2</a> (tem pra Mac OS, Windows e Linux &#8211; a versão shareware não expira!)</li>
<li>Browser (de preferência <a href="http://www.getfirefox.net/" target="_blank">Firefox </a>com Firebug ou <a href="http://www.google.com/chrome" target="_blank">Chrome</a>).</li>
</ul>
<p><em><strong>Vídeo</strong></em>:</p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/41764951" frameborder="0" width="500" height="281"></iframe></p>
<p><em><strong>Vimeo</strong></em>: <strong><a href="http://vimeo.com/loiane/curso-extjs4-aula25" target="_blank">http://vimeo.com/loiane/curso-extjs4-aula25</a></strong></p>
<p><strong><em>YouTube</em>: em breve</strong></p>
<p><em><strong>Código</strong></em>: <a href="https://github.com/loiane/curso-extjs4" target="_blank">https://github.com/loiane/curso-extjs4</a></p>
<p><em><strong>Slides:</strong></em></p>
<div id="__ss_12856329" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Curso ExtJS 4 - Aula 25: MessageBox: Dialog" href="http://www.slideshare.net/loianeg/curso-extjs-4-aula-25-messagebox-dialog">Curso ExtJS 4 &#8211; Aula 25: MessageBox: Dialog</a></strong><object id="__sse12856329" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=curso-extjs4-aula25-120508192427-phpapp01&amp;stripped_title=curso-extjs-4-aula-25-messagebox-dialog&amp;userName=loianeg" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12856329" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=curso-extjs4-aula25-120508192427-phpapp01&amp;stripped_title=curso-extjs-4-aula-25-messagebox-dialog&amp;userName=loianeg" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/loianeg">Loiane Groner</a>.</div>
</div>
<p><strong style="display: block; margin: 12px 0 4px;">Até a próxima aula! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4329&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/qD__yP4kZxccrcOvZb2qjR4BGi8/0/da"><img src="http://feedads.g.doubleclick.net/~a/qD__yP4kZxccrcOvZb2qjR4BGi8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qD__yP4kZxccrcOvZb2qjR4BGi8/1/da"><img src="http://feedads.g.doubleclick.net/~a/qD__yP4kZxccrcOvZb2qjR4BGi8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=raZrWCqLJ2s:On27BYtkzks:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=raZrWCqLJ2s:On27BYtkzks:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=raZrWCqLJ2s:On27BYtkzks:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/raZrWCqLJ2s" height="1" width="1"/>]]></content:encoded><description>Vídeo/Screencast de hoje: aula 25 do curso gratuito de Ext JS 4! Na aula de hoje vamos aprender como usar o MessageBox, aquela janela de alert. Vamos aprender todos os tipos de dialogs que podemos fazer com ExtJS, inclusive os customizados. Quem quiser ver todas as aulas já publicadas, é só clicar aqui. Espero que gostem [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/curso-de-extjs-4-aula-25-messagebox-dialog/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/curso-de-extjs-4-aula-25-messagebox-dialog/</feedburner:origLink></item><item><title>Començando com Ext GWT 3 / GXT 3: Hello World</title><link>http://feedproxy.google.com/~r/Loiane/~3/DQ71r5KSBkk/</link><category>Ext GWT 3 - GXT 3</category><category>Tutoriais</category><category>Ext GWT</category><category>Ext GWT 3</category><category>GXT</category><category>GXT 3</category><category>Hello World</category><category>Sencha</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Tue, 08 May 2012 00:30:59 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4078</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Mais um tutorial inédito aqui no blog e super fresquinho! A <a href="http://www.sencha.com/" target="_blank">Sencha</a> anunciou alguns dias atrás o release candidate do <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> 3 e em breve teremos uma versão final.</p>
<p>Confesso que fiquei bem empolgada com a nova versão do framework, pois está cheia de novidades! Os pacotes passaram por uma reformulação de nomes, já que a empresa antes não se chamava <a href="http://www.sencha.com/" target="_blank">Sencha</a>, mas sim ExtJS.</p>
<p>Bem, pra quem não conhece o <a href="http://www.sencha.com/products/extgwt/" target="_blank">Ext GWT</a>, ou como também é chamado, <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a>, é um framework Java mantido pela Sencha baseado totalmente no <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a> (o framework Java do Google), mas com a cara e interface linda que o ExtJS tem!</p>
<p>Os componentes UI do <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> são bem parecidos com os do <a href="http://www.sencha.com/products/extjs/" target="_blank">ExtJS</a>, mas com uma diferença: o código você faz TODO em Java, e o <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a> se encarrega de gerar todo o código javascript para você.</p>
<p>Bem, o objetivo do post de hoje, além de fazer esta breve introdução, é mostrar como preparar o ambiente de desenvolvimento para começar a programar com o <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> e fazer um simples Hello World!</p>
<p>Realmente não sei como desenvolvedora Java e amante dos produtos da Sencha nunca escrevi sobre esse framework aqui no blog antes!</p>
<p>Vamos ao que interessa então!</p>
<p>Requisitos para este Tutorial &#8211; vou assumir que você seja um desenvolvedor Java e já tenha os seguintes items:</p>
<ul>
<li>Conhecimentos de Java</li>
<li>Ter o <a href="http://www.oracle.com/technetwork/java/index.html" target="_blank">Java SDK</a> instalado na máquina</li>
<li><a href="http://eclipse.org/" target="_blank">Eclipse</a></li>
<li>Fazer Download do <a href="http://www.sencha.com/products/extgwt/" target="_blank">Ext GWT</a> 3</li>
</ul>
<p>Passo a passo desse tutorial:</p>
<ol>
<li>Instalar o Google Eclipse Plugin</li>
<li>Criar o projeto</li>
<li>Adicionar as bibliotecas necessárias</li>
<li>Desenvolver a aplicação</li>
<li>Executar a aplicação</li>
</ol>
<h1>Instalando o Google Eclipse Plugin</h1>
<p>Um requisito para desenvolvermos projetos em <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> é ter o Google Eclipse Plugin instalado, já que o <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> é baseado no <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a>. O primeiro passo então é abrir o Market Place do Eclipse e fazer uma busca por &#8220;google&#8221;. Depois que a busca estiver feita, vamos procurar o Google Plugin for Eclipse como destacado no screenshot abaixo. Irão ter outras opções com a versão do Eclipse também, mas esta versão que não mostra a versão do Eclipse irá automaticamente detectar a versão que você está usando o instalar o plugin compatível. E para instalar, basta usar o botão &#8220;Install&#8221;.</p>
<p>Uma dica muito importante: use o Java JDK 6 no Eclipse para instalar o Google Eclipse Plugin. Se estiver usando o JDK 7, vai dar erro.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-01.png"><img class="aligncenter size-full wp-image-4090" title="ext-gwt-gxt-loiane-01" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-01.png" alt="" width="562" height="751" /></a></p>
<p>O Eclipse vai calcular alguns requerimentos e também irá buscar pela versão correta a ser instalada no Eclipse. Neste caso clique em &#8220;Next&#8221; para prosseguir com a instalação:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-02.png"><img class="aligncenter size-full wp-image-4091" title="ext-gwt-gxt-loiane-02" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-02.png" alt="" width="562" height="319" /></a></p>
<p>Aceite os termos e prossiga com a instalação:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-03.png" target="_blank"><img class="aligncenter  wp-image-4092" title="ext-gwt-gxt-loiane-03" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-03.png" alt="" width="556" height="325" /></a></p>
<p>Pronto! Agora basta reiniciar o Eclipse para que as mudanças sejam aplicadas na IDE.</p>
<h1>Criando o Projeto</h1>
<p>Assim que reiniciarmos o Eclipse, um ícone do Google irá aparecer na barra de ferramentas da IDE. Para criar um novo projeto, clique na &#8220;seta para baixo&#8221; ao lado do ícone do Google e selecione &#8220;New Web Application Project&#8221;:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-04.png"><img class="aligncenter size-full wp-image-4093" title="ext-gwt-gxt-loiane-04" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-04.png" alt="" width="289" height="222" /></a></p>
<p>Dê um nome para o projeto (neste tutorial dei o nome de ext-gwt-helloworl), informe o nome do pacote base que irá usar (neste caso escolhi com.loiane.gxt3). Depois deixe apenas a opção &#8220;Use Google Web Toolkit&#8221; selecionada. Assim vamos criar um projeto &#8220;zerado&#8221;:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-05.png"><img class="aligncenter size-full wp-image-4094" title="ext-gwt-gxt-loiane-05" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-05.png" alt="" width="524" height="700" /></a></p>
<p>Pronto, o projeto foi gerado seguindo a estrutura de um projeto do <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a>.</p>
<h1>Adicionando as Bibliotecas</h1>
<p>Como queremos criar um projeto usando o <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> 3, precisamos adicionar o jar correspondente da biblioteca ao projeto, já que este já contém as bibliotecas do <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a> necessárias. Selecione o projeto, clique com o botão direito e escolha &#8220;Build Path&#8221; -&gt; &#8220;Configure Build Path&#8221;:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-06.png" target="_blank"><img class="aligncenter  wp-image-4095" title="ext-gwt-gxt-loiane-06" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-06.png" alt="" width="571" height="604" /></a></p>
<p>Uma nova janela irá se abrir. Escolha a tab &#8220;Libraries&#8221; e clique em &#8220;Add External JARs&#8230;&#8221;.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-07.png"><img class="aligncenter size-full wp-image-4096" title="ext-gwt-gxt-loiane-07" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-07.png" alt="" width="564" height="533" /></a></p>
<p>Vá até o diretório onde descompactou o SDK do <a href="http://www.sencha.com/products/extgwt/" target="_blank">Ext GWT</a> e selecione apenas o jar do gxt 3, como mostra o screenshot abaixo:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-08.png" target="_blank"><img class="aligncenter  wp-image-4097" title="ext-gwt-gxt-loiane-08" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-08.png" alt="" width="559" height="432" /></a></p>
<p>Pronto, o <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> já está adicionado no classpath do projeto. Clique em OK:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-09.png" target="_blank"><img class="aligncenter  wp-image-4098" title="ext-gwt-gxt-loiane-09" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-09.png" alt="" width="525" height="375" /></a></p>
<h1>Desenvolvendo a Aplicação &#8211; Código</h1>
<p>Agora que o projeto já está todo configurado, vamos começar com a diversão e implementar a nossa primeira aplicação com <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> 3. Para isso, selecione o projeto, clique com o botão direto e escolha &#8220;New&#8221; -&gt; &#8220;Other&#8221;. Ache o folder do &#8220;Google Web Toolkit&#8221; e escolha &#8220;Module&#8221;:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-10.png"><img class="aligncenter size-full wp-image-4100" title="ext-gwt-gxt-loiane-10" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-10.png" alt="" width="522" height="496" /></a></p>
<p>Escolha o pacote (que escolhemos quando criamos o projeto, lembra?) e dê um nome para o módulo. Como essa é a nossa primeira applicacação, chamei de &#8220;HelloWorl&#8221;:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-11.png"><img class="aligncenter size-full wp-image-4101" title="ext-gwt-gxt-loiane-11" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-11.png" alt="" width="524" height="499" /></a></p>
<p>O plugin do Google vai criar um arquivo xml chamado &#8220;Hello World.gwt.xml&#8221; como mostrado abaixo. Mas como queremos criar uma aplicação com <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a>, temos que fazer algumas mudanças.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-12.png"><img class="aligncenter size-full wp-image-4102" title="ext-gwt-gxt-loiane-12" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-12.png" alt="" width="523" height="182" /></a></p>
<p>Para fazermos essas mudanças, temos que adicionar a seguinte linha no arquivo xml:</p>
<pre class="brush: xml; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
</pre>
<p>Vamos aproveitar e dar um alias para o módulo de &#8220;helloworld&#8221; para facilitar as chamadas que iremos fazer daqui a pouco. No final, seu arquivo xml deve ficar assim:</p>
<pre class="brush: xml; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

	&lt;source path=&quot;client&quot; /&gt;
</pre>
<p>Agora vamos criar uma classe Entry Point. Para quem nunca trabalhou com <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a> antes, a classe que extende um EntryPoint funciona como uma espécie de classe Main, que será executada quando executarmos a aplicação. Novamente, selecione o projeto, clique com o botão direto e escolha &#8220;New&#8221; -&gt; &#8220;Other&#8221;. Ache o folder do &#8220;Google Web Toolkit&#8221; e escolha &#8220;Entry Point Class&#8221;:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-13.png"><img class="aligncenter size-full wp-image-4103" title="ext-gwt-gxt-loiane-13" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-13.png" alt="" width="520" height="497" /></a></p>
<p>O nome da nossa EntryPoint class será HelloWorld. Clique em Finish &#8211; um detalhe: depois de criar essa classe, note que o plugin automaticamente adicionou uma linha no arquivo de configuração do xml:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-14.png"><img class="aligncenter size-full wp-image-4107" title="ext-gwt-gxt-loiane-14" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-14.png" alt="" width="523" height="575" /></a></p>
<p>Agora que a classe está criada, vamos abrir a classe e adicionar o código do <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a>:</p>
<pre class="brush: java; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
package com.loiane.gxt3.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.widget.core.client.box.MessageBox;

public class HelloWorld implements EntryPoint {

	@Override
	public void onModuleLoad() {

		MessageBox messageBox = new MessageBox(&quot;First GXT 3 App&quot;, &quot;Hello, World!&quot;);

		RootPanel.get().add(messageBox);

		messageBox.show();

	}

}
</pre>
<p>O código acima irá mostrar uma MessageBox (componente muito parecido com o do ExtJS) com um título e uma mensagem de &#8220;Hello, World!&#8221;.</p>
<p>Agora precisamos criar uma página HTML. Novamente, selecione a pasta &#8220;<em><strong>war</strong></em>&#8221; do projeto, clique com o botão direto e escolha &#8220;New&#8221; -&gt; &#8220;Other&#8221;. Ache o folder do &#8220;Google Web Toolkit&#8221; e escolha &#8220;HTML Page&#8221;:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-15.png"><img class="aligncenter size-full wp-image-4108" title="ext-gwt-gxt-loiane-15" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-15.png" alt="" width="522" height="496" /></a></p>
<p>Dê um nome para a página HTML. Geralmente damos o mesmo nome do módulo:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-16.png"><img class="aligncenter size-full wp-image-4109" title="ext-gwt-gxt-loiane-16" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-16.png" alt="" width="520" height="496" /></a></p>
<p>Pronto, a página HTML será criada. Precisamos fazer uma modificação para adicionar o css do <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> 3. No final, o código HTML deve ficar parecido com o código abaixo:</p>
<pre class="brush: xml; collapse: false; first-line: 1; highlight: [7]; title: ; toolbar: true; wrap-lines: false; notranslate">

    HelloWorld

&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;helloworld/helloworld.nocache.js&quot;&gt;&lt;/script&gt;

&lt;/pre&gt;
&lt;iframe id=&quot;__gwt_historyFrame&quot; style=&quot;position: absolute; width: 0; height: 0; border: 0;&quot; src=&quot;javascript:''&quot; width=&quot;320&quot; height=&quot;240&quot;&gt;&lt;/iframe&gt;
&lt;pre&gt;
</pre>
<h1>Executando</h1>
<p>Pronto, nosso Hello World está implementado e agora vamos executar o projeto pela primeira vez. Como estamos usando o <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a>, não precisamos nos preocupar em instalar nenhum webserver, pois o plugin do Google já vem com um especialmente projetado para executar projetos <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a>. Para isso, vamos clicar novamente com o botão direito no projeto, e escolher a opção &#8220;Run As&#8221; -&gt; &#8220;Web Application&#8221; (repare no ícone do plugin do Google):</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-17.png" target="_blank"><img class="aligncenter  wp-image-4110" title="ext-gwt-gxt-loiane-17" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-17.png" alt="" width="569" height="413" /></a></p>
<p style="text-align: left;">O console do &#8220;Development Mode&#8221; vai abrir e se tudo estiver OK, vai mostrar um link. Dê um duplo clique no link e o seu browser default irá abrir.</p>
<p style="text-align: left;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-18.png"><img class="aligncenter size-full wp-image-4111" title="ext-gwt-gxt-loiane-18" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-18.png" alt="" width="598" height="132" /></a></p>
<p style="text-align: left;">Se você nunca executou um projeto <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a> no seu browser antes, vai pedir para instalar o plugin do Google. Instale.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-19.png" target="_blank"><img class="aligncenter  wp-image-4112" title="ext-gwt-gxt-loiane-19" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-19.png" alt="" width="573" height="309" /></a></p>
<p style="text-align: left;">Dê um duplo clique novamente na url e agora que já temos o plugin do Google para app <a href="https://developers.google.com/web-toolkit/" target="_blank">GWT</a> instalado no browser, a seguinte tela deve aparecer.</p>
<p style="text-align: left;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-21.png"><img class="aligncenter size-full wp-image-4113" title="ext-gwt-gxt-loiane-21" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-21.png" alt="" width="574" height="423" /></a></p>
<p style="text-align: left;">Parabéns! Criamos e executamos nossa primeira aplicação <a href="http://www.sencha.com/products/extgwt/" target="_blank">GXT</a> 3 juntos!</p>
<h1 style="text-align: left;">Estrutura Final do Projeto</h1>
<p>No final, a estrutura do projeto deve ficar assim:</p>
<p style="text-align: left;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-20.png"><img class="aligncenter size-full wp-image-4114" title="ext-gwt-gxt-loiane-20" src="http://www.loiane.com/wp-content/uploads/2012/03/ext-gwt-gxt-loiane-20.png" alt="" width="308" height="260" /></a></p>
<h1>Download do Código Fonte</h1>
<p>Você pode fazer download do código fonte completo desse tutorial no meu repositório do github: <a href="https://github.com/loiane/ext-gwt3-helloworld" target="_blank">https://github.com/loiane/ext-gwt3-helloworld</a></p>
<p>Até a próxima! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4078&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/0PZbWkWivaGOtk-vELrt_YANN1s/0/da"><img src="http://feedads.g.doubleclick.net/~a/0PZbWkWivaGOtk-vELrt_YANN1s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/0PZbWkWivaGOtk-vELrt_YANN1s/1/da"><img src="http://feedads.g.doubleclick.net/~a/0PZbWkWivaGOtk-vELrt_YANN1s/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=DQ71r5KSBkk:GIrLWKeWYXI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=DQ71r5KSBkk:GIrLWKeWYXI:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=DQ71r5KSBkk:GIrLWKeWYXI:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/DQ71r5KSBkk" height="1" width="1"/>]]></content:encoded><description>Mais um tutorial inédito aqui no blog e super fresquinho! A Sencha anunciou alguns dias atrás o release candidate do GXT 3 e em breve teremos uma versão final. Confesso que fiquei bem empolgada com a nova versão do framework, pois está cheia de novidades! Os pacotes passaram por uma reformulação de nomes, já que [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/comencando-com-ext-gwt-3-gxt-3-hello-world/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/comencando-com-ext-gwt-3-gxt-3-hello-world/</feedburner:origLink></item><item><title>ExtJS 4 Exemplo MVC: Exemplo de Comboboxes Aninhados com PHP e MySQL</title><link>http://feedproxy.google.com/~r/Loiane/~3/e_ssRJ6kHHc/</link><category>Ext JS 4</category><category>ExtJS 4</category><category>ExtJS 4 MVC</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Mon, 07 May 2012 00:30:11 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4352</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Em 2010 <a href="http://www.loiane.com/2010/10/tutorial-combo-boxes-aninhados-com-extjs-spring-mvc-3-e-hibernate-3-5/" target="_blank">publiquei um tutorial sobre combobooxes aninhados, mas em ExtJS 3</a>. Algumas coisas mudaram em ExtJS 4, então decidi fazer um update no tutorial. Mudei também a linguagem de backend de Java para PHP.</p>
<p>O que vai mudar entre o tutorial do ExtJS 3 e ExtJS 4 é apenas o frontend, ou seja, o código ExtJS. Se quiser pode usar o<a href="http://www.loiane.com/2010/10/tutorial-combo-boxes-aninhados-com-extjs-spring-mvc-3-e-hibernate-3-5/" target="_blank"> backend que fiz no post passado</a> com o código do ExtJS 4 ou o código do ExtJS 3 com o backend feito em PHP deste post.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-linked-combobox-loiane.jpg"><img class="aligncenter size-full wp-image-4424" title="extjs4-linked-combobox-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-linked-combobox-loiane.jpg" alt="" width="364" height="402" /></a></p>
<p>Vamos lá!</p>
<h2>Estrutura do Projeto:</h2>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-linked-combobox.png"><img class="aligncenter size-full wp-image-4461" title="extjs4-linked-combobox" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-linked-combobox.png" alt="" width="566" height="576" /></a></p>
<h2>Código ExtJS 4:</h2>
<h3>Model &#8211; Estado</h3>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.State',{
    extend: 'Ext.data.Model',
    fields: [
       {name: 'state_id'},
       {name: 'state_name'}
    ],
    idProperty: 'state_id'
});
</pre>
<h3>Store &#8211; Estados</h3>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.store.States',{
    extend: 'Ext.data.Store',

    storeId: 'statesStore',

    model: 'ExtMVC.model.State',

    autoLoad:true,

    proxy: {
        type: 'ajax',

        url: 'php/listStates.php',

        reader: {
                type: 'json',
                root: 'data'
        }
    }
});
</pre>
<h3>Model &#8211; Cidade</h3>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.City',{
    extend: 'Ext.data.Model',
    fields: [
       {name: 'city_id'},
       {name: 'state_id'},
       {name: 'city_name'}
    ],

    idProperty: 'city_id'
});
</pre>
<h3>Store &#8211; Cidades</h3>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.store.Cities',{
    extend: 'Ext.data.Store',

    model: 'ExtMVC.model.City',

    proxy: {
        type: 'ajax',

        url: 'php/listCities.php',

        reader: {
                type: 'json',
                root: 'data'
        }
    }
});
</pre>
<h3>View</h3>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.StateCityCombo' ,{
    extend: 'Ext.form.Panel',
    alias : 'widget.statecityform',

    frame: true,
    title:'Linked Comboboxes',
    style:'margin:16px',
    bodyStyle:'padding:10px',

    fieldDefaults: {
        labelAlign: 'right',
        labelWidth: 85,
        msgTarget: 'side'
     },

    items: [{
        xtype: 'combo',
        id: 'stateCombo',
        fieldLabel:'Select State',
        displayField:'state_name',
        valueField:'state_id',
        store: Ext.create('ExtMVC.store.States'),
        triggerAction:'all',
        mode:'local',
    },
    {
        xtype: 'combo',
        id: 'cityCombo',
        fieldLabel:'Select City',
        displayField:'city_name',
        valueField:'city_id',
        store: Ext.create('ExtMVC.store.Cities'),
        triggerAction:'all',
        mode:'local',
        disabled:true,
        lastQuery:''
    }]

 });
</pre>
<h3>ViewPort</h3>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.Viewport', {
    extend: 'Ext.Viewport',
    layout: 'fit',

    requires: [
        'ExtMVC.view.StateCityCombo'
    ],

    initComponent: function() {
        var me = this;

        Ext.apply(me, {
            items: [
                {
                    xtype: 'statecityform'
                }
            ]
        });

        me.callParent(arguments);
    }
});
</pre>
<h3>Controller</h3>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.controller.LinkedComboboxes', {
    extend: 'Ext.app.Controller',

    models: ['State', 'City'],

    stores: ['States', 'Cities'],

    views: ['StateCityCombo'],

    init: function() {

        this.control({
            'statecityform #stateCombo': {
                select: this.loadCityCombo
            }
        });
    },

     loadCityCombo: function(combo, records) {

        var comboCity = Ext.ComponentQuery.query('statecityform #cityCombo')[0];

        comboCity.setDisabled(true);
        comboCity.setValue('');
        comboCity.store.removeAll();

        comboCity.store.load({
            params: { stateId: combo.getValue() }
        });
        comboCity.setDisabled(false);
     }
});
</pre>
<h3>App</h3>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.Loader.setConfig({enabled: true});

Ext.application({
    name: 'ExtMVC',

    controllers: [
        'LinkedComboboxes'
    ],

    autoCreateViewport: true
});
</pre>
<h2>listaEstados.php</h2>
<pre class="brush: php; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;?php
    //chama o arquivo de conexão com o bd
    include(&quot;database.php&quot;);

    //consulta sql
    $query = mysql_query(&quot;SELECT * FROM State&quot;) or die(mysql_error());

    //faz um looping e cria um array com os campos da consulta
    $rows = array('data' =&gt; array());
    while($state = mysql_fetch_assoc($query)) {
        $rows['data'][] = $state;
    }

    //encoda para formato JSON
    echo json_encode($rows);
?&gt;
</pre>
<h2>listaCidades.php</h2>
<pre class="brush: php; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;?php
    //chama o arquivo de conexão com o bd
    include(&quot;database.php&quot;);

    $stateId = $_REQUEST['stateId'];

    $queryString = &quot;SELECT * FROM City WHERE state_id = &quot; . $stateId;

    //consulta sql
    $query = mysql_query($queryString) or die(mysql_error());

    //faz um looping e cria um array com os campos da consulta
    $rows = array('data' =&gt; array());
    while($city = mysql_fetch_assoc($query)) {
        $rows['data'][] = $city;
    }

    //encoda para formato JSON
    echo json_encode($rows);
?&gt;
</pre>
<h2>Download do Código Fonte:</h2>
<p>Você pode fazer o download do código fonte completo no meu repositório do github: <a href="https://github.com/loiane/extjs4-linked-combobox" target="_blank">https://github.com/loiane/extjs4-linked-combobox</a></p>
<h2>Demo:</h2>
<p>Exemplo funcionando: <a href="http://loiane.com/extjs/extjs4-linked-combobox/" target="_blank">http://loiane.com/extjs/extjs4-linked-combobox/</a></p>
<p>Até a próxima!</p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4352&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/kiGdCe1UFf9mo5SE-ZYISY1Xh6E/0/da"><img src="http://feedads.g.doubleclick.net/~a/kiGdCe1UFf9mo5SE-ZYISY1Xh6E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/kiGdCe1UFf9mo5SE-ZYISY1Xh6E/1/da"><img src="http://feedads.g.doubleclick.net/~a/kiGdCe1UFf9mo5SE-ZYISY1Xh6E/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=e_ssRJ6kHHc:LJFG8xgqWM0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=e_ssRJ6kHHc:LJFG8xgqWM0:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=e_ssRJ6kHHc:LJFG8xgqWM0:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/e_ssRJ6kHHc" height="1" width="1"/>]]></content:encoded><description>Em 2010 publiquei um tutorial sobre combobooxes aninhados, mas em ExtJS 3. Algumas coisas mudaram em ExtJS 4, então decidi fazer um update no tutorial. Mudei também a linguagem de backend de Java para PHP. O que vai mudar entre o tutorial do ExtJS 3 e ExtJS 4 é apenas o frontend, ou seja, o [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/extjs-4-exemplo-mvc-exemplo-de-comboboxes-aninhados-com-php-e-mysql/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">9</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/extjs-4-exemplo-mvc-exemplo-de-comboboxes-aninhados-com-php-e-mysql/</feedburner:origLink></item><item><title>Just Java 2012: Eu Vou (E Vou Palestrar)!</title><link>http://feedproxy.google.com/~r/Loiane/~3/VHBdS7jCPaI/</link><category>Eventos</category><category>ExtJS 4</category><category>Java</category><category>JAX-RS</category><category>Just Java</category><category>NetBeans</category><category>palestra</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Fri, 04 May 2012 00:30:27 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4403</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Ei Pessoal,</p>
<p>Pois é, mais um evento neste mês de maio! Terceiro fim de semana seguido que palestro em algum evento! Dessa vez vou palestrar no <a href="http://justjava.soujava.org.br/" target="_blank">Just Java 2012</a>, em São Paulo. O evento será realizado nos dias 18 e 19 de maio no SENAC de Santo Amaro.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/just_java_2012.png"><img class="wp-image-4404 aligncenter" title="just_java_2012" src="http://www.loiane.com/wp-content/uploads/2012/04/just_java_2012.png" alt="" width="547" height="104" /></a></p>
<p>Vou palestrar sobre <a href="http://justjava.soujava.org.br/program" target="_blank">ExtJS 4 e Jax-RS</a>. A palestra vai ser mais hands-on, usando Netbeans, Jax-RS e ExtJS 4. Vou fazer uma aplicação de exemplo para mostrar como é simples de usar o Jax-RS com Netbeans, e além disso, mostrar também que não é preciso usar Java em toda a aplicação, ou seja, é fácil integrar uma API Java com alguma outra tecnologia.</p>
<p>O evento conta com grandes nomes da comunidade Java brasileira e internacional, como Bruno Javaman, Fabiane Nardon, Yara e Vinícius Senger, Maltron, Mike Milinkovich (Eclipse Foundation), Stephen Chin (Oracle &#8211; the FX guy!), entre outros.</p>
<p>Se você está em São Paulo e trabalha com Java, este evento é imperdível!</p>
<p>Nos vemos lá!</p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4403&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/oTIjtdUu3cmQBnN0sdY5-GuKQoY/0/da"><img src="http://feedads.g.doubleclick.net/~a/oTIjtdUu3cmQBnN0sdY5-GuKQoY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oTIjtdUu3cmQBnN0sdY5-GuKQoY/1/da"><img src="http://feedads.g.doubleclick.net/~a/oTIjtdUu3cmQBnN0sdY5-GuKQoY/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=VHBdS7jCPaI:hueEwTS36pI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=VHBdS7jCPaI:hueEwTS36pI:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=VHBdS7jCPaI:hueEwTS36pI:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/VHBdS7jCPaI" height="1" width="1"/>]]></content:encoded><description>Ei Pessoal, Pois é, mais um evento neste mês de maio! Terceiro fim de semana seguido que palestro em algum evento! Dessa vez vou palestrar no Just Java 2012, em São Paulo. O evento será realizado nos dias 18 e 19 de maio no SENAC de Santo Amaro. Vou palestrar sobre ExtJS 4 e Jax-RS. [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/just-java-2012-eu-vou-e-vou-palestrar/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/just-java-2012-eu-vou-e-vou-palestrar/</feedburner:origLink></item><item><title>[Curso de Sencha Touch 2] Aula 02: Instalação e Hello World</title><link>http://feedproxy.google.com/~r/Loiane/~3/qRNejt-Bihc/</link><category>Curso Sencha Touch 2</category><category>Sencha Touch</category><category>Sencha Touch 2</category><category>Touch</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Thu, 03 May 2012 00:30:49 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4375</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Vídeo/Screencast de hoje: aula 02 do novo curso online gratuito aqui do blog: <strong>Sencha Touch 2</strong>!</p>
<p>Na aula de hoje vamos aprender como fazer o download, instalar em um webserver para acesso offline, vamos aprender para que serve cada arquivo que vem com o SDK, vamos fazer um hello world e executá-lo em um browser e um smartphone.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/curso-sencha-touch2-aula02-loiane.png"><img class="aligncenter size-full wp-image-4478" title="curso-sencha-touch2-aula02-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/curso-sencha-touch2-aula02-loiane.png" alt="" width="473" height="356" /></a></p>
<p>Quem quiser ver todas as aulas já publicadas, é só <a title="Curso de Sencha Touch 2 – Gratuito!" href="http://www.loiane.com/2012/03/curso-de-sencha-touch-2-gratuito/" target="_blank">clicar aqui</a>.</p>
<p>Recomendo altamente aprender ExtJS 4 também, afinal parte da API do Sencha Touch 2 é compartilhada com ExtJS 4. Você pode acompanhar o <a title="Curso de ExtJS 4 – Gratuito!" href="http://www.loiane.com/2011/11/curso-de-extjs-4-gratuito/" target="_blank">curso gratuito de ExtJS 4 aqui</a>.</p>
<p>Espero que gostem dessa aula e fico no aguardo do feedback de vocês! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em><strong>Requerimentos:</strong></em></p>
<ul>
<li>SDK Sencha Touch 2</li>
<li>Editor de Texto</li>
<li>WebServer (Apache)</li>
<li>Smartphone ou tablet (opcional)</li>
</ul>
<p><em><strong>Vídeo</strong></em>:</p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/41378400" frameborder="0" width="500" height="313"></iframe></p>
<p><em><strong>Vimeo</strong></em>: <strong><a href="http://vimeo.com/loiane/curso-senchatouch2-aula02" target="_blank">http://vimeo.com/loiane/curso-senchatouch2-aula02</a></strong></p>
<p><strong><em>YouTube</em>: em breve</strong></p>
<p><em><strong>Código</strong></em>: <a href="https://github.com/loiane/curso-touch2" target="_blank">https://github.com/loiane/curso-touch2</a></p>
<p><em><strong>Slides:</strong></em></p>
<div id="__ss_12692220" style="width: 425px;">
<p><strong style="display: block; margin: 12px 0 4px;"><a title="Curso Sencha Touch 2 - Aula 02 - Instalacao e Hello World" href="http://www.slideshare.net/loianeg/curso-sencha-touch-2-aula-02-instalacao-e-hello-world" target="_blank">Curso Sencha Touch 2 &#8211; Aula 02 &#8211; Instalacao e Hello World</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/12692220" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="425" height="355"></iframe></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/loianeg" target="_blank">Loiane Groner</a></div>
</div>
<p><strong>Até a próxima aula! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4375&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/3fsorPI5NXywMTSIBzuPVRMvT6M/0/da"><img src="http://feedads.g.doubleclick.net/~a/3fsorPI5NXywMTSIBzuPVRMvT6M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3fsorPI5NXywMTSIBzuPVRMvT6M/1/da"><img src="http://feedads.g.doubleclick.net/~a/3fsorPI5NXywMTSIBzuPVRMvT6M/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=qRNejt-Bihc:EXCBG3Gz0Ec:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=qRNejt-Bihc:EXCBG3Gz0Ec:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=qRNejt-Bihc:EXCBG3Gz0Ec:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/qRNejt-Bihc" height="1" width="1"/>]]></content:encoded><description>Vídeo/Screencast de hoje: aula 02 do novo curso online gratuito aqui do blog: Sencha Touch 2! Na aula de hoje vamos aprender como fazer o download, instalar em um webserver para acesso offline, vamos aprender para que serve cada arquivo que vem com o SDK, vamos fazer um hello world e executá-lo em um browser [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/curso-de-sencha-touch-2-aula-02-instalacao-e-hello-world/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">9</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/curso-de-sencha-touch-2-aula-02-instalacao-e-hello-world/</feedburner:origLink></item><item><title>Erro no Tomcat e Eclipse: Cannot create a server using the selected type</title><link>http://feedproxy.google.com/~r/Loiane/~3/WEtvZIHtGqs/</link><category>Tomcat</category><category>eclipse</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Wed, 02 May 2012 00:30:12 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4315</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Algumas vezes, quando deletamos alguma configuração de servidor do workspace ou se movemos o workspace de lugar (por exemplo, copy e paste em outro diretório ou outra máquina), criar um novo servidor Tomcat (com a mesma versão) pode ser um pouco chato, pois o Eclipse pode dar um erro de <strong>Cannot create a server using the selected type, </strong>como mostra a figura abaixo.</p>
<p>E neste caso, você só poderá criar um outro server de uma versão diferente.</p>
<p>Tive esse problema na semana passada, quando migrei meus arquivos para uma nova máquina no trabalho. Mesmo tendo copiado o workspace e a pasta do eclipse com todas as configurações, tive esse erro.</p>
<p>Vamos ver como corrigir esse problema.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/erro-tomcat-cannot-create-server-loiane.jpg" target="_blank"><img class="aligncenter  wp-image-4342" title="erro-tomcat-cannot-create-server-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/erro-tomcat-cannot-create-server-loiane.jpg" alt="" width="406" height="438" /></a></p>
<p>Para resolver esse erro, siga os passos:</p>
<ol>
<li>Vá em Window–&gt;Preferences–&gt;Server–&gt;Runtime Environments e faça um fiz do path do diretório do servidor.</li>
<li>Agora vá no diretório do workspace (<em>\workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings</em>) e renomeie ou delete o arquivo <strong>org.eclipse.jst.server.tomcat.core.prefs </strong> (se for renomear, pode ser para <strong>org.eclipse.jst.server.tomcat.core.prefs.bak</strong>).</li>
<li>Renomeie o arquivo  <strong>org.eclipse.wst.server.core.prefs </strong>para  <strong>org.eclipse.wst.server.core.prefs.bak </strong>(ou delete o arquivo). Este arquivo também se encontra no diretório <em>\workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings.</em></li>
</ol>
<div>Pronto! Por precaução, restarte o eclipse e tente adicionar o server novamente!</div>
<div></div>
<div>Até a próxima! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4315&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/9wP-wCFErmSKhND0Mr8kX8OUFMM/0/da"><img src="http://feedads.g.doubleclick.net/~a/9wP-wCFErmSKhND0Mr8kX8OUFMM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/9wP-wCFErmSKhND0Mr8kX8OUFMM/1/da"><img src="http://feedads.g.doubleclick.net/~a/9wP-wCFErmSKhND0Mr8kX8OUFMM/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=WEtvZIHtGqs:dpVLRyYHrsI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=WEtvZIHtGqs:dpVLRyYHrsI:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=WEtvZIHtGqs:dpVLRyYHrsI:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/WEtvZIHtGqs" height="1" width="1"/>]]></content:encoded><description>Algumas vezes, quando deletamos alguma configuração de servidor do workspace ou se movemos o workspace de lugar (por exemplo, copy e paste em outro diretório ou outra máquina), criar um novo servidor Tomcat (com a mesma versão) pode ser um pouco chato, pois o Eclipse pode dar um erro de Cannot create a server using the [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/erro-no-tomcat-e-eclipse-cannot-create-a-server-using-the-selected-type/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/erro-no-tomcat-e-eclipse-cannot-create-a-server-using-the-selected-type/</feedburner:origLink></item><item><title>PHP: Como se conectar ao MySQL</title><link>http://feedproxy.google.com/~r/Loiane/~3/9z3hr0VbJ3k/</link><category>PHP</category><category>MySQL</category><category>php</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Tue, 01 May 2012 00:30:35 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=3912</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Como comecei a aprender PHP a pouco tempo, resolvi criar alguns posts para consulta própria, e quem sabe pode ser útil para outras pessoas também né?</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/phpmysql.png"><img class="aligncenter  wp-image-4439" title="phpmysql" src="http://www.loiane.com/wp-content/uploads/2012/04/phpmysql.png" alt="" width="407" height="180" /></a></p>
<p>O post de hoje é uma dica de código bem rápida, mostrando apenas como se conectar com o MySQL usando o PHP:</p>
<pre class="brush: php; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;?php

//nome do servidor (127.0.0.1)
$servidor = &quot;127.0.0.1&quot;;

//usuário do banco de dados
$user = &quot;root&quot;;

//senha do banco de dados
$senha = &quot;root&quot;;

//nome da base de dados
$db = &quot;blog&quot;;

//executa a conexão com o banco, caso contrário mostra o erro ocorrido
$conexao = mysql_connect($servidor,$user,$senha) or die (mysql_error());

//seleciona a base de dados daquela conexão, caso contrário mostra o erro ocorrido
$banco = mysql_select_db($db, $conexao) or die(mysql_error());

?&gt;
</pre>
<p>Bons códigos! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=3912&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/WqxLfUa-3yfTuTdwrtO9s1doGBw/0/da"><img src="http://feedads.g.doubleclick.net/~a/WqxLfUa-3yfTuTdwrtO9s1doGBw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/WqxLfUa-3yfTuTdwrtO9s1doGBw/1/da"><img src="http://feedads.g.doubleclick.net/~a/WqxLfUa-3yfTuTdwrtO9s1doGBw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=9z3hr0VbJ3k:s5JFx-PZAzA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=9z3hr0VbJ3k:s5JFx-PZAzA:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=9z3hr0VbJ3k:s5JFx-PZAzA:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/9z3hr0VbJ3k" height="1" width="1"/>]]></content:encoded><description>Como comecei a aprender PHP a pouco tempo, resolvi criar alguns posts para consulta própria, e quem sabe pode ser útil para outras pessoas também né? O post de hoje é uma dica de código bem rápida, mostrando apenas como se conectar com o MySQL usando o PHP: Bons códigos!</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/05/php-como-se-conectar-ao-mysql/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><feedburner:origLink>http://www.loiane.com/2012/05/php-como-se-conectar-ao-mysql/</feedburner:origLink></item><item><title>Exemplo ExtJS 4 MVC: MultiSelect e ItemSelector</title><link>http://feedproxy.google.com/~r/Loiane/~3/pP5gbjYLRqs/</link><category>Ext JS 4</category><category>ExtJS 4</category><category>ExtJS 4 MVC</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Mon, 30 Apr 2012 00:30:36 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4363</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo <a href="http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/multiselect/multiselect-demo.html" target="_blank">MultiSelect and ItemSelector &#8211; Form</a>.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-multiselect-loiane.jpg"><img class="aligncenter size-full wp-image-4428" title="extjs4-mvc-multiselect-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-multiselect-loiane.jpg" alt="" width="409" height="315" /></a></p>
<p>Vamos ao código então!</p>
<h2>Estrutura do Projeto</h2>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-multiselect.png"><img class="aligncenter size-full wp-image-4459" title="extjs4-mvc-multiselect" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-multiselect.png" alt="" width="566" height="650" /></a></p>
<h2>Model – Number</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.Number',{
    extend: 'Ext.data.Model',
    fields: [
       {name: 'value'},
       {name: 'text'}
    ],
    idProperty: 'value'
});
</pre>
<h2>Store- Numbers</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.store.Numbers', {
    extend: 'Ext.data.ArrayStore',
    model: 'ExtMVC.model.Number',

    data: [
        [123,'One Hundred Twenty Three'],
        ['1', 'One'],
        ['2', 'Two'],
        ['3', 'Three'],
        ['4', 'Four'],
        ['5', 'Five'],
        ['6', 'Six'],
        ['7', 'Seven'],
        ['8', 'Eight'],
        ['9', 'Nine']
    ],

    sortInfo: {
        field: 'value',
        direction: 'ASC'
    }
 });
</pre>
<h2>View &#8211; ItemSelectorForm</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.ItemSelectorForm', {
    extend: 'Ext.form.Panel',
    alias : 'widget.itemselectorform',

    requires: [
        'Ext.ux.form.ItemSelector',
        'ExtMVC.view.DockedToolbar',
        'ExtMVC.view.DockedButtons'
    ],

    title: 'ItemSelector Test',
    width: 700,
    bodyPadding: 10,
    height: 300,
    layout: 'fit',

    items:[{
        xtype: 'itemselector',
        name: 'itemselector',
        id: 'itemselector-field',
        anchor: '100%',
        fieldLabel: 'ItemSelector',
        store: Ext.create('ExtMVC.store.Numbers'),
        displayField: 'text',
        valueField: 'value',
        value: ['3', '4', '6'],
        allowBlank: false,
        msgTarget: 'side'
    }],

    dockedItems: [{
        xtype: 'toptoolbar',
        dock: 'top'
    },{
        xtype: 'bottombuttons',
        dock: 'bottom'
    }]
})
</pre>
<h2>View &#8211; MultiSelectForm</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.MultiSelectForm', {
    extend: 'Ext.form.Panel',
    alias : 'widget.multiselectform',

    requires: [
        'Ext.ux.form.MultiSelect',
        'ExtMVC.view.DockedToolbar',
        'ExtMVC.view.DockedButtons'
    ],

    title: 'MultiSelect Test',
    bodyPadding: 10,
    width: 700,

    items:[{
        anchor: '100%',
        xtype: 'multiselect',
        msgTarget: 'side',
        fieldLabel: 'Multiselect',
        name: 'multiselect',
        id: 'multiselect-field',
        allowBlank: false,
        store: Ext.create('ExtMVC.store.Numbers'),
        displayField: 'text',
        valueField: 'value',
        value: ['3', '4', '6'],
        ddReorder: true
    }],

    dockedItems: [{
        xtype: 'toptoolbar',
        dock: 'top'
    },{
        xtype: 'bottombuttons',
        dock: 'bottom'
    }]
})
</pre>
<h2>View &#8211; DockedToolbar</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.DockedToolbar', {
    extend: 'Ext.toolbar.Toolbar',
    alias : 'widget.toptoolbar',

    items: [{
        text: 'Options',
        menu: [{
            text: 'Get value',
            action: 'getValue'
        }, {
            text: 'Set value (2,3)',
            action: 'setValue'
        },{
            text: 'Toggle enabled',
            checked: true,
            action: 'enable'
        },{
            text: 'Toggle delimiter',
            checked: true,
            action: 'delimiter'
        }]
    }]
});
</pre>
<h2>View &#8211; DockedButtons</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.DockedButtons', {
    extend: 'Ext.toolbar.Toolbar',
    alias : 'widget.bottombuttons',

    ui: 'footer',
    defaults: {
        minWidth: 75
    },

    items: ['-&gt;', {
        text: 'Clear',
        action: 'clear'
    }, {
        text: 'Reset',
        action: 'reset'
    }, {
        text: 'Save',
        action: 'save'
    }]

});
</pre>
<h2>View- Viewport</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
/**
 * The main application viewport, which displays the whole application
 * @extends Ext.Viewport
 */
Ext.define('ExtMVC.view.Viewport', {
    extend: 'Ext.Viewport',

    layout: {
        type:'vbox',
        padding: 10,
        align:'stretch'
     },

    requires: [
        'ExtMVC.view.MultiSelectForm',
        'ExtMVC.view.ItemSelectorForm'
    ],

    initComponent: function() {
        var me = this;

        Ext.apply(me, {
            items: [
                {
                    xtype: 'multiselectform'
                },{
                    xtype: 'box',
                    html: '&lt;/br&gt;'
                },{
                    xtype: 'itemselectorform'
                }
            ]
        });

        me.callParent(arguments);
    }
});
</pre>
<h2>Controller</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.controller.SelectController', {
    extend: 'Ext.app.Controller',

    models: ['Number'],

    stores: ['Numbers'],

    views: ['MultiSelectForm', 'ItemSelectorForm'],

    init: function() {

        this.control({
            'form bottombuttons button[action=clear]': {
                click: this.clearForm
            },
            'form bottombuttons button[action=reset]': {
                click: this.resetForm
            },
            'form bottombuttons button[action=save]': {
                click: this.saveForm
            },
            'form toptoolbar menuitem[action=getValue]': {
                click: this.getValue
            },
            'form toptoolbar menuitem[action=setValue]': {
                click: this.setValue
            },
            'form toptoolbar menuitem[action=enable]': {
                checkchange: this.enable
            },
            'form toptoolbar menuitem[action=delimiter]': {
                checkchange: this.delimiter
            }
        });
    },

    clearForm: function(button){

        var field = button.up('form').down('multiselect');
        if (!field.disabled) {
            field.clearValue();
        }
    },

    resetForm: function(button){

        button.up('form').getForm().reset();
    },

    saveForm: function(button){

        var form = button.up('form').getForm();
        form.getValues(true);
        if (form.isValid()){
            Ext.Msg.alert('Submitted Values', 'The following will be sent to the server: &lt;br /&gt;'+
                form.getValues(true));
        }
    },

    getValue: function(item){

        var value = item.up('form').down('multiselect').getValue();
        Ext.Msg.alert('Value is a split array', value.join(', '));
    },

    setValue: function(item){

        var value = item.up('form').down('multiselect').setValue(['2', '3']);
    },

    enable: function(item, checked){

        item.up('form').down('multiselect').setDisabled(!checked);
    },

    delimiter: function(item, checked){

        var field = item.up('form').down('multiselect');
        if (checked) {
            field.delimiter = ',';
            Ext.Msg.alert('Delimiter Changed', 'The delimiter is now set to &lt;b&gt;&quot;,&quot;&lt;/b&gt;. Click Save to ' +
                          'see that values are now submitted as a single parameter separated by the delimiter.');
        } else {
            field.delimiter = null;
            Ext.Msg.alert('Delimiter Changed', 'The delimiter is now set to &lt;b&gt;null&lt;/b&gt;. Click Save to ' +
                          'see that values are now submitted as separate parameters.');
        }
    }
});
</pre>
<h2>App.js</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', 'app/ux');

Ext.application({
    name: 'ExtMVC',

    controllers: [
        'SelectController'
    ],

    autoCreateViewport: true
});
</pre>
<h2>Página HTML</h2>
<pre class="brush: xml; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Ext JS 4 MVC Examples - loiane.com&lt;/title&gt;

	&lt;!-- Ext JS Files --&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;extjs/resources/css/ext-all.css&quot;&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;extjs/ext-all-debug.js&quot;&gt;&lt;/script&gt;

    &lt;!-- Plugin Files --&gt;
    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;resources/ItemSelector.css&quot; /&gt;

    &lt;!-- App Files --&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>Download do código fonte completo</h2>
<p>Você pode fazer o download do código fonte completo através dos meu repositório do Github: <a href="https://github.com/loiane/extjs4-mvc-multiselect">https://github.com/loiane/extjs4-mvc-multiselect</a></p>
<h2>Demo</h2>
<p>Para ver esse projeto rodando, acesse o link: <a href="http://loiane.com/extjs/extjs4-mvc-multiselect/" target="_blank">http://loiane.com/extjs/extjs4-mvc-multiselect/</a></p>
<h3>Todos os exemplos ExtJS 4 MVC:</h3>
<p><a href="http://www.loiane.com/2012/03/exemplos-sencha-extjs-4-em-mvc/" target="_blank">http://www.loiane.com/2012/03/exemplos-sencha-extjs-4-em-mvc/</a></p>
<p>Até o próximo exemplo! <img src="http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4363&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/RRJZ6A34faelrjX_6AzvChVZNT4/0/da"><img src="http://feedads.g.doubleclick.net/~a/RRJZ6A34faelrjX_6AzvChVZNT4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/RRJZ6A34faelrjX_6AzvChVZNT4/1/da"><img src="http://feedads.g.doubleclick.net/~a/RRJZ6A34faelrjX_6AzvChVZNT4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=pP5gbjYLRqs:xxwXk09iQ5U:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=pP5gbjYLRqs:xxwXk09iQ5U:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=pP5gbjYLRqs:xxwXk09iQ5U:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/pP5gbjYLRqs" height="1" width="1"/>]]></content:encoded><description>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo MultiSelect and ItemSelector &amp;#8211; Form. Vamos ao código então! Estrutura do Projeto Model – Number Store- Numbers View &amp;#8211; ItemSelectorForm View &amp;#8211; MultiSelectForm View &amp;#8211; DockedToolbar View &amp;#8211; DockedButtons View- Viewport Controller App.js Página HTML Download do código fonte [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/exemplo-extjs-4-mvc-multiselect-e-itemselector/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/exemplo-extjs-4-mvc-multiselect-e-itemselector/</feedburner:origLink></item><item><title>JavaCE Community Conference: Eu Vou (E Vou Palestrar)!</title><link>http://feedproxy.google.com/~r/Loiane/~3/hhDmS4aUQMU/</link><category>Eventos</category><category>ExtJS 4</category><category>Java</category><category>JavaCE</category><category>palestra</category><category>VRaptor</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Fri, 27 Apr 2012 00:30:12 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4396</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Ei Pessoal,</p>
<p>No mês de maio estarei novamente em Fortaleza &#8211; Ceará participando e palestrando na <a href="http://conference.javace.org/" target="_blank">JavaCE Community Conference</a>. O evento será realizado nos dias 11 e 12 de maio de 2012 na Faculdade 7 de Setembro.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/javace_417x168.jpg"><img class="size-full wp-image-4397 aligncenter" title="javace_417x168" src="http://www.loiane.com/wp-content/uploads/2012/04/javace_417x168.jpg" alt="" width="417" height="168" /></a></p>
<p>Vou palestrar sobre ExtJS 4 e VRaptor e minha palestra será na sexta às 09:00h, logo depois da palestra do Paulo Silveira (responsa hein!).</p>
<p>O evento conta ainda com grandes nomes da comunidade Java brasileira, como Paulo Silveira, Mauricio Linhares, Douglas Campos (qmx), Fernando Meyer, Otávio Gonçalves (Java Bahia), Bruno Javaman, entre outras feras!</p>
<p>Vou levar 2 livros autografados para sorter entre os participantes do evento também! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Estive em Fortaleza em 2011 pela primeira vez para palestrar no BrazilJS e amei a cidade! Fui no <a href="http://www.mercadocentraldefortaleza.com.br/" target="_blank">mercado central</a> e comprei castanha de cajú, farinha (farinha nordestina é a melhor do mundo!), doces e artesanato local. O pessoal também me levou num lugar para comer pizza de carne de sol/carne seca (caracas, é muuuuito bom!). Espero ir nesse lugar novamente viu Handerson !? rs <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Nos vemos lá! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4396&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/UkRJevuZPQaVME0GNF3bW2wNDig/0/da"><img src="http://feedads.g.doubleclick.net/~a/UkRJevuZPQaVME0GNF3bW2wNDig/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/UkRJevuZPQaVME0GNF3bW2wNDig/1/da"><img src="http://feedads.g.doubleclick.net/~a/UkRJevuZPQaVME0GNF3bW2wNDig/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=hhDmS4aUQMU:xvhYbaMaj-Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=hhDmS4aUQMU:xvhYbaMaj-Q:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=hhDmS4aUQMU:xvhYbaMaj-Q:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/hhDmS4aUQMU" height="1" width="1"/>]]></content:encoded><description>Ei Pessoal, No mês de maio estarei novamente em Fortaleza &amp;#8211; Ceará participando e palestrando na JavaCE Community Conference. O evento será realizado nos dias 11 e 12 de maio de 2012 na Faculdade 7 de Setembro. Vou palestrar sobre ExtJS 4 e VRaptor e minha palestra será na sexta às 09:00h, logo depois da palestra [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/javace-community-conference-eu-vou-e-vou-palestrar/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/javace-community-conference-eu-vou-e-vou-palestrar/</feedburner:origLink></item><item><title>[Curso CSS3 com Sass e Compass] Aula 05: Variáveis</title><link>http://feedproxy.google.com/~r/Loiane/~3/KHcyH8Xx1PQ/</link><category>Curso Sass e Compass</category><category>Compass</category><category>CSS</category><category>CSS3</category><category>curso</category><category>Sass</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Thu, 26 Apr 2012 00:30:50 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4369</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Vídeo/Screencast de hoje: aula 05 do curso gratuito de CSS3 com Sass e Compass!</p>
<p>Na aula de hoje vamos aprender como declarar e usar variáveis no código sass. Vamos ver como acertar erros que podem acontecer no código sass também.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/curso-css3-sass-compass-aula05-loiane.png"><img class="aligncenter size-full wp-image-4471" title="curso-css3-sass-compass-aula05-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/curso-css3-sass-compass-aula05-loiane.png" alt="" width="472" height="354" /></a></p>
<p>Quem quiser ver todas as aulas já publicadas, é só <a title="Curso Online: CSS3 com Sass e Compass – Gratuito!" href="http://www.loiane.com/2012/03/curso-online-css3-com-sass-e-compass-gratuito/" target="_blank">clicar aqui</a>.</p>
<p>Espero que gostem dessa aula e fico no aguardo do feedback de vocês! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em><strong>Requerimentos:</strong></em></p>
<ul>
<li>Ruby</li>
<li>Gem Sass</li>
<li>Editor de Texto. Nas aulas estou usando o <a href="http://www.sublimetext.com/" target="_blank">Sublime Text 2</a>.</li>
<li><a href="http://mhs.github.com/scout-app/" target="_blank">Scout</a> (Windows e Mac)  - sorry, não tem pra Linux - ou linha de comando.</li>
</ul>
<p><em><strong>Vídeo</strong></em>:</p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/41038325" frameborder="0" width="500" height="313"></iframe></p>
<p><em><strong>Vimeo</strong></em>: <strong><a href="http://vimeo.com/loiane/curso-sass-compass-aula05" target="_blank">http://vimeo.com/loiane/curso-sass-compass-aula05</a></strong></p>
<p><strong><em>YouTube</em>: em breve</strong></p>
<p><em><strong>Slides:</strong></em></p>
<div id="__ss_12640064" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Curso CSS3 com Sass e Compass - Aula 05: Variaveis" href="http://www.slideshare.net/loianeg/curso-css3-com-sass-e-compass-aula-05-variaveis" target="_blank">Curso CSS3 com Sass e Compass &#8211; Aula 05: Variaveis</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/12640064" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="425" height="355"></iframe></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/loianeg" target="_blank">Loiane Groner</a></div>
</div>
<p><strong><em><strong>Até a próxima aula! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></em></strong></p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4369&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/G9L43WLNiBaD7WeZPoWHx5b4ORI/0/da"><img src="http://feedads.g.doubleclick.net/~a/G9L43WLNiBaD7WeZPoWHx5b4ORI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/G9L43WLNiBaD7WeZPoWHx5b4ORI/1/da"><img src="http://feedads.g.doubleclick.net/~a/G9L43WLNiBaD7WeZPoWHx5b4ORI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=KHcyH8Xx1PQ:vouZ2o1nG0w:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=KHcyH8Xx1PQ:vouZ2o1nG0w:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=KHcyH8Xx1PQ:vouZ2o1nG0w:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/KHcyH8Xx1PQ" height="1" width="1"/>]]></content:encoded><description>Vídeo/Screencast de hoje: aula 05 do curso gratuito de CSS3 com Sass e Compass! Na aula de hoje vamos aprender como declarar e usar variáveis no código sass. Vamos ver como acertar erros que podem acontecer no código sass também. Quem quiser ver todas as aulas já publicadas, é só clicar aqui. Espero que gostem [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/curso-css3-com-sass-e-compass-aula-05-variaveis/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/curso-css3-com-sass-e-compass-aula-05-variaveis/</feedburner:origLink></item><item><title>Bug Ext JS 4.1: suspendEvents não Afeta Ext.app.Controller.control – MVC</title><link>http://feedproxy.google.com/~r/Loiane/~3/zMneI3lcKTY/</link><category>Ext JS 4</category><category>Erro ExtJS 4</category><category>ExtJS 4</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Wed, 25 Apr 2012 00:30:51 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4378</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><img class="alignleft size-full wp-image-4379" title="extjs4-mvc-lg1" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-lg1.png" alt="" width="268" height="180" /></p>
<p>Como vocês sabem, estou<a title="Exemplos Sencha ExtJS 4 em MVC" href="http://www.loiane.com/2012/03/exemplos-sencha-extjs-4-em-mvc/" target="_blank"> postando os exemplos da Sencha no formato MVC aqui no blog</a>. Essa semana, quando estava migrando um exemplo para MVC, me deparei com um bug do ExtJS.</p>
<p>Quando (por algum motivo) é necessário chamar o método suspendEvents de alguma classe, e essa mesma classe (geralmente um componente UI) tem um listener no control da classe controller de uma aplicação MVC, esse método não funciona e continua disparando os eventos.</p>
<p>Depois de muita dor de cabeça e muito debug, resolvi procurar no fórum da Sencha sobre esse problema. E não é que tem um <a href="http://www.sencha.com/forum/showthread.php?171525-suspendEvents-did-not-affect-to-Ext.app.Controller.control" target="_blank">bug aberto sobre isso</a> lá? Sorte que <a href="http://www.sencha.com/forum/showthread.php?171525-suspendEvents-did-not-affect-to-Ext.app.Controller.control" target="_blank">nessa thread</a> tem também uma solução temporária enquanto o pessoal da Sencha não acerta isso.</p>
<p>Bem, se você está passando por esse mesmo problema, e a versão que você está usando é a ExtJS 4.1  ou inferior, ou se o bug ainda estiver marcado como OPEN no fórum, adicione esse overrride no seu código que tudo volta a funcionar normalmente:</p>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
/*
 * BUG: suspentEvents not honoured in Ext.app.EventBus
 *
 * note: this fix does not queue events when asked.
 *
 * http://www.sencha.com/forum/showthread.php?171525
 */
Ext.syncRequire('Ext.app.EventBus');
Ext.override(Ext.app.EventBus, {
    constructor: function() {
        this.mixins.observable.constructor.call(this);

        this.bus = {};

        var me = this;
        Ext.override(Ext.Component, {
            fireEvent: function(ev) {
// [
// --
//              if (Ext.util.Observable.prototype.fireEvent.apply(this, arguments) !== false) {
// ++
                if (Ext.util.Observable.prototype.fireEvent.apply(this, arguments) !== false &amp;&amp; !this.eventsSuspended) {
// ]
                    return me.dispatch.call(me, ev, this, arguments);
                }
                return false;
            }
        });
    }
});
</pre>
<p>Esse bug está aberto desde janeiro de 2012 e fiquei um pouco chateada por ele estar aberto até abril (mês que escrevi esse post). O MVC está sendo adotado pelo pessoal que começou a migrar e eu já estou ficando viciada em escrever apenas em MVC e não mais do modo estruturado como fazia com o ExtJS 3. E um bug desses realmente atrapalha (além dos outros existentes relacionados a MVC) e pode fazer com que algumas pessoas demorem mais para adotar a nova arquitetura, já que ela foi criada para ser usada como padrão de desenvolvimento em ExtJS.</p>
<p>Bons códigos!</p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4378&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/7cd3O6o8LNz8SfbvqyFGLCg_glw/0/da"><img src="http://feedads.g.doubleclick.net/~a/7cd3O6o8LNz8SfbvqyFGLCg_glw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/7cd3O6o8LNz8SfbvqyFGLCg_glw/1/da"><img src="http://feedads.g.doubleclick.net/~a/7cd3O6o8LNz8SfbvqyFGLCg_glw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=zMneI3lcKTY:6ZjHyGCX7Es:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=zMneI3lcKTY:6ZjHyGCX7Es:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=zMneI3lcKTY:6ZjHyGCX7Es:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/zMneI3lcKTY" height="1" width="1"/>]]></content:encoded><description>Como vocês sabem, estou postando os exemplos da Sencha no formato MVC aqui no blog. Essa semana, quando estava migrando um exemplo para MVC, me deparei com um bug do ExtJS. Quando (por algum motivo) é necessário chamar o método suspendEvents de alguma classe, e essa mesma classe (geralmente um componente UI) tem um listener no [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/bug-ext-js-4-1-suspendevents-nao-afeta-ext-app-controller-control-mvc/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/bug-ext-js-4-1-suspendevents-nao-afeta-ext-app-controller-control-mvc/</feedburner:origLink></item><item><title>ExtJS 4: Validação CPF / CNPJ de Acordo com Opção Selecionada</title><link>http://feedproxy.google.com/~r/Loiane/~3/KWJbQSfmBf8/</link><category>Ext JS 4</category><category>CNPJ</category><category>CPF</category><category>ExtJS 4</category><category>Validação ExtJS</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Wed, 25 Apr 2012 00:30:04 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=3899</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Tempos atrás postei um<a title="ExtJS 4 Form: Exemplo Campos CPF e CNPJ" href="http://www.loiane.com/2011/08/extjs-4-form-exemplo-campos-cpf-e-cnpj/" target="_blank"> post sobre duas extensões de campos de forms do ExtJS 4 para CPF e CNPJ já com validação</a>. Só que reparei que uma dúvida comum que as pessoas tem é como ter apenas um campo (CPF ou CNPJ) e deixar que o usuário escolha qual campo usar. E ainda assim, fazer com que as validações funcionem.</p>
<p>Bem, por este motivo criei um exemplo. Fique á vontade para usar no seu projeto ou fazer melhorias! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>O exemplo já utiliza o ComponentQuery e não utiliza o Ext.getCmp (arg!). Tentei seguir as melhores práticas para este exemplo! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>O exemplo funciona assim:</p>
<p>CPF selecionado:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-validacao-cpf-cnpj-loiane-01.png"><img class="aligncenter size-full wp-image-4306" title="extjs4-validacao-cpf-cnpj-loiane-01" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-validacao-cpf-cnpj-loiane-01.png" alt="" width="260" height="109" /></a></p>
<p>CNPJ selecionado:</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-validacao-cpf-cnpj-loiane-02.png"><img class="aligncenter size-full wp-image-4307" title="extjs4-validacao-cpf-cnpj-loiane-02" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-validacao-cpf-cnpj-loiane-02.png" alt="" width="259" height="110" /></a></p>
<p>Vamos ao código então!</p>
<h2>Código:</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.Loader.setConfig({enabled: true});

Ext.require([
	'Ux.CpfField',
	'Ux.CnpjField'
]);

Ext.onReady(function() {

	Ext.create('Ext.form.Panel', {
		renderTo: Ext.getBody(),
		title: 'Exemplo Campos CPF e CNPJ',
		width: 250,
		bodyPadding: 5,
		fieldDefaults: {
			labelAlign: 'left',
			labelWidth: 50,
			anchor: '100%',
			msgTarget: 'under'
		},
		defaultType: 'textfield',
		items: [
		{
            xtype      : 'radiogroup',
            fieldLabel : 'Tipo de Pessoa',
            columns: 2,
            items: [
                {
                    boxLabel  : 'Física',
                    name      : 'tipoPessoa',
                    inputValue: 'cpf',
                    checked   : true
                }, {
                    boxLabel  : 'Jurídica',
                    name      : 'tipoPessoa',
                    inputValue: 'cnpj'
                }
            ],
            onChange: function(field){
            	var novoValor = field.tipoPessoa;
            	if (!Ext.isArray(novoValor)) {
            		if (novoValor == 'cpf') {
            		var cpf = Ext.ComponentQuery.query('cpffield')[0];
            		var cnpj = Ext.ComponentQuery.query('cnpjfield')[0];
            		cpf.setVisible(true);
            		cnpj.setVisible(false);
            	} else {
            		var cpf = Ext.ComponentQuery.query('cpffield')[0];
            		var cnpj = Ext.ComponentQuery.query('cnpjfield')[0];
            		cpf.setVisible(false);
            		cnpj.setVisible(true);
            	}
            	}
            }
        },
		{
			fieldLabel: 'CPF',
			name: 'cpf',
			xtype: 'cpffield',
			hidden: false
		},{
			fieldLabel: 'CNPJ',
			name: 'cpnj',
			xtype: 'cnpjfield',
			hidden: true
		}]
	});

});
</pre>
<h2>Download do código fonte:</h2>
<p>Você pode fazer o download do código fonte completo no meu repositório do github: <a href="https://github.com/loiane/extjs4-validacao-cpf-cnpj">https://github.com/loiane/extjs4-validacao-cpf-cnpj</a></p>
<h2>Demo:</h2>
<p>Quer ver esse exemplo funcionando? Clique no link: <a href="http://www.loiane.com/extjs/extjs4-validacao-cpf-cnpj/">http://www.loiane.com/extjs/extjs4-validacao-cpf-cnpj/</a></p>
<p>Até a próxima!</p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=3899&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/7phk8wdWP6LsbpCbds5JKlftCzw/0/da"><img src="http://feedads.g.doubleclick.net/~a/7phk8wdWP6LsbpCbds5JKlftCzw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/7phk8wdWP6LsbpCbds5JKlftCzw/1/da"><img src="http://feedads.g.doubleclick.net/~a/7phk8wdWP6LsbpCbds5JKlftCzw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=KWJbQSfmBf8:MxLB8TDfdmM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=KWJbQSfmBf8:MxLB8TDfdmM:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=KWJbQSfmBf8:MxLB8TDfdmM:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/KWJbQSfmBf8" height="1" width="1"/>]]></content:encoded><description>Tempos atrás postei um post sobre duas extensões de campos de forms do ExtJS 4 para CPF e CNPJ já com validação. Só que reparei que uma dúvida comum que as pessoas tem é como ter apenas um campo (CPF ou CNPJ) e deixar que o usuário escolha qual campo usar. E ainda assim, fazer [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/extjs-4-validacao-cpf-cnpj-de-acordo-com-opcao-selecionada/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/extjs-4-validacao-cpf-cnpj-de-acordo-com-opcao-selecionada/</feedburner:origLink></item><item><title>Exemplo ExtJS 4 Grid: Multiline Row</title><link>http://feedproxy.google.com/~r/Loiane/~3/4uSvJIcdJ2Q/</link><category>Ext JS 4</category><category>ExtJS 4</category><category>grid</category><category>Multiline Row</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Tue, 24 Apr 2012 00:30:56 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4243</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>O post de hoje é uma dica rápida de como alterar o grid do ExtJS 4 para que ele suporte um conteúdo de várias linhas em um record do grid.</p>
<p>Por exemplo, veja o grid abaixo:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-grid-multiline-row-loiane-02.jpg"><img class="aligncenter  wp-image-4269" title="extjs4-grid-multiline-row-loiane-02" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-grid-multiline-row-loiane-02.jpg" alt="" width="550" height="189" /></a></p>
<p>Na descrição queremos exibir o seguinte conteúdo:</p>
<blockquote><p><em>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.</em><br />
<em> Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit.</em></p></blockquote>
<p>Bem grande para apenas uma linha não é mesmo?</p>
<p>O que podemos então fazer para que o grid exiba todo esse conteúdo acima?</p>
<p>Basta acrescentar o seguinte css no seu projeto:</p>
<pre class="brush: css; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
.x-grid-row .x-grid-cell-inner {
	white-space: normal;
}
.x-grid-row-over .x-grid-cell-inner {
	font-weight: bold;
	white-space: normal;
}
</pre>
<p>E a grid irá ficar assim:</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-grid-multiline-row-loiane-01.jpg"><img class="aligncenter  wp-image-4268" title="extjs4-grid-multiline-row-loiane-01" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-grid-multiline-row-loiane-01.jpg" alt="" width="549" height="191" /></a></p>
<p>Vamos ver como fica o código completo apresentado nesse post:</p>
<h3>Código ExtJS 4:</h3>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.require([
    'Ext.grid.*',
    'Ext.data.*'
]);

Ext.define('Post', {
    extend: 'Ext.data.Model',
    fields: [
       {name: 'post'},
       {name: 'desc'}
    ]
});

Ext.onReady(function() {

    // sample static data for the store
    var myData = [
        ['ExtJS 4 Grid Multiline Row',
        'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh,'+
        'sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis,'+
        'interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada,'+
        'libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non'+
        'sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.'+
		'Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui,'+
		'consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed,'+
		'luctus eu,'+
		'massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit.']
    ];

    // create the data store
    var store = Ext.create('Ext.data.ArrayStore', {
        model: 'Post',
        data: myData
    });

    // create the Grid
    var grid = Ext.create('Ext.grid.Panel', {
        store: store,
        stateful: true,
        collapsible: true,
        multiSelect: true,
        columns: [
            {
                text     : 'Post',
          		width    : 150,
                sortable : false,
                dataIndex: 'post'
            },
            {
                text     : 'Description',
                flex     : 1,
                sortable : false,
                dataIndex: 'desc'
            }
        ],
        height: 200,
        width: 600,
        title: 'Array Grid',
        renderTo: 'grid-example',
        viewConfig: {
            stripeRows: true,
            enableTextSelection: true
        }
    });
});
</pre>
<h3>Código HTML:</h3>
<pre class="brush: xml; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Ext JS 4 Examples - loiane.com&lt;/title&gt;

	&lt;!-- Ext JS Files --&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;extjs/resources/css/ext-all.css&quot;&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;extjs/ext-all.js&quot;&gt;&lt;/script&gt;

    &lt;!-- App Files --&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;

    &lt;style type=&quot;text/css&quot;&gt;
	.x-grid-row .x-grid-cell-inner {
		white-space: normal;
	}
	.x-grid-row-over .x-grid-cell-inner {
		font-weight: bold;
		white-space: normal;
	}
    &lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;
	&lt;div id=&quot;grid-example&quot; style=&quot;padding:20px;&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3>Download do Código Fonte:</h3>
<p>Você pode fazer o download do código fonte completo através dos meu repositório do Github: <a href="https://github.com/loiane/extjs4-grid-multiline-row" target="_blank">https://github.com/loiane/extjs4-grid-multiline-row</a></p>
<h3>Demo:</h3>
<p>Para ver esse projeto rodando, acesse o link: <a href="http://loiane.com/extjs/extjs4-grid-multiline-row" target="_blank">http://loiane.com/extjs/extjs4-grid-multiline-row</a></p>
<p>Até a próxima! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4243&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/KNz-21r8ZY1LeDgq2MrXiFCbHJ0/0/da"><img src="http://feedads.g.doubleclick.net/~a/KNz-21r8ZY1LeDgq2MrXiFCbHJ0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/KNz-21r8ZY1LeDgq2MrXiFCbHJ0/1/da"><img src="http://feedads.g.doubleclick.net/~a/KNz-21r8ZY1LeDgq2MrXiFCbHJ0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=4uSvJIcdJ2Q:CfcQqTOAQA8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=4uSvJIcdJ2Q:CfcQqTOAQA8:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=4uSvJIcdJ2Q:CfcQqTOAQA8:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/4uSvJIcdJ2Q" height="1" width="1"/>]]></content:encoded><description>O post de hoje é uma dica rápida de como alterar o grid do ExtJS 4 para que ele suporte um conteúdo de várias linhas em um record do grid. Por exemplo, veja o grid abaixo: Na descrição queremos exibir o seguinte conteúdo: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/exemplo-extjs-4-grid-multiline-row/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/exemplo-extjs-4-grid-multiline-row/</feedburner:origLink></item><item><title>Exemplo ExtJS 4 MVC: XML Ajax Form</title><link>http://feedproxy.google.com/~r/Loiane/~3/UovmBd43YVk/</link><category>Ext JS 4</category><category>ExtJS 4</category><category>ExtJS 4 MVC</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Mon, 23 Apr 2012 00:30:04 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4225</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo <a href="http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/form/xml-form.html" target="_blank">Ajax with XML Forms</a>.<br />
<a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-ajax-xml-form-loiane.jpg"><img class="aligncenter size-full wp-image-4282" title="extjs4-mvc-ajax-xml-form-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-ajax-xml-form-loiane.jpg" alt="" width="349" height="293" /></a></p>
<p>Vamos ao código então!</p>
<h2>Estrutura do Projeto</h2>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-ajax-xml-form-loiane-011.png"><img class="aligncenter size-full wp-image-4301" title="extjs4-mvc-ajax-xml-form-loiane-01" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-ajax-xml-form-loiane-011.png" alt="" width="566" height="650" /></a></p>
<h2>Model &#8211; Contact</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.Contact',{
    extend: 'Ext.data.Model',
    fields: [
        {name: 'first', mapping: 'name &gt; first'},
        {name: 'last', mapping: 'name &gt; last'},
        'company',
        'email',
        'state',
        {name: 'dob', type: 'date', dateFormat: 'm/d/Y'}
    ]
});
</pre>
<h2>Model &#8211; FieldError</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.FieldError',{
    extend: 'Ext.data.Model',
    fields: ['id', 'msg']
});
</pre>
<h2>Model &#8211; State</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.State',{
    extend: 'Ext.data.Model',
    fields: ['abbr', 'state']
});
</pre>
<h2>Store &#8211; States</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.store.States',{
    extend: 'Ext.data.ArrayStore',

    model: 'ExtMVC.model.State',

    data: [
        ['AL', 'Alabama', 'The Heart of Dixie'],
        ['AK', 'Alaska', 'The Land of the Midnight Sun'],
        ['AZ', 'Arizona', 'The Grand Canyon State'],
        ['AR', 'Arkansas', 'The Natural State'],
        ['CA', 'California', 'The Golden State'],
        ['CO', 'Colorado', 'The Mountain State'],
        ['CT', 'Connecticut', 'The Constitution State'],
        ['DE', 'Delaware', 'The First State'],
        ['DC', 'District of Columbia', &quot;The Nation's Capital&quot;],
        ['FL', 'Florida', 'The Sunshine State'],
        ['GA', 'Georgia', 'The Peach State'],
        ['HI', 'Hawaii', 'The Aloha State'],
        ['ID', 'Idaho', 'Famous Potatoes'],
        ['IL', 'Illinois', 'The Prairie State'],
        ['IN', 'Indiana', 'The Hospitality State'],
        ['IA', 'Iowa', 'The Corn State'],
        ['KS', 'Kansas', 'The Sunflower State'],
        ['KY', 'Kentucky', 'The Bluegrass State'],
        ['LA', 'Louisiana', 'The Bayou State'],
        ['ME', 'Maine', 'The Pine Tree State'],
        ['MD', 'Maryland', 'Chesapeake State'],
        ['MA', 'Massachusetts', 'The Spirit of America'],
        ['MI', 'Michigan', 'Great Lakes State'],
        ['MN', 'Minnesota', 'North Star State'],
        ['MS', 'Mississippi', 'Magnolia State'],
        ['MO', 'Missouri', 'Show Me State'],
        ['MT', 'Montana', 'Big Sky Country'],
        ['NE', 'Nebraska', 'Beef State'],
        ['NV', 'Nevada', 'Silver State'],
        ['NH', 'New Hampshire', 'Granite State'],
        ['NJ', 'New Jersey', 'Garden State'],
        ['NM', 'New Mexico', 'Land of Enchantment'],
        ['NY', 'New York', 'Empire State'],
        ['NC', 'North Carolina', 'First in Freedom'],
        ['ND', 'North Dakota', 'Peace Garden State'],
        ['OH', 'Ohio', 'The Heart of it All'],
        ['OK', 'Oklahoma', 'Oklahoma is OK'],
        ['OR', 'Oregon', 'Pacific Wonderland'],
        ['PA', 'Pennsylvania', 'Keystone State'],
        ['RI', 'Rhode Island', 'Ocean State'],
        ['SC', 'South Carolina', 'Nothing Could be Finer'],
        ['SD', 'South Dakota', 'Great Faces, Great Places'],
        ['TN', 'Tennessee', 'Volunteer State'],
        ['TX', 'Texas', 'Lone Star State'],
        ['UT', 'Utah', 'Salt Lake State'],
        ['VT', 'Vermont', 'Green Mountain State'],
        ['VA', 'Virginia', 'Mother of States'],
        ['WA', 'Washington', 'Green Tree State'],
        ['WV', 'West Virginia', 'Mountain State'],
        ['WI', 'Wisconsin', &quot;America's Dairyland&quot;],
        ['WY', 'Wyoming', 'Like No Place on Earth']
    ]
});
</pre>
<h2>View &#8211; Form</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.contact.ContactForm' ,{
    extend: 'Ext.form.Panel',
    alias : 'widget.contactform',

	frame: true,
    title:'XML Form',
    bodyPadding: 5,
    waitMsgTarget: true,

    fieldDefaults: {
            labelAlign: 'right',
            labelWidth: 85,
            msgTarget: 'side'
     },

    items: [{
        xtype: 'fieldset',
        title: 'Contact Information',
        defaultType: 'textfield',
        defaults: {
            width: 280
        },
        items: [{
                fieldLabel: 'First Name',
                emptyText: 'First Name',
                name: 'first'
            }, {
                fieldLabel: 'Last Name',
                emptyText: 'Last Name',
                name: 'last'
            }, {
                fieldLabel: 'Company',
                name: 'company'
            }, {
                fieldLabel: 'Email',
                name: 'email',
                vtype:'email'
            }, {
                xtype: 'combobox',
                fieldLabel: 'State',
                name: 'state',
                store: 'States',
                valueField: 'abbr',
                displayField: 'state',
                typeAhead: true,
                queryMode: 'local',
                emptyText: 'Select a state...'
            }, {
                xtype: 'datefield',
                fieldLabel: 'Date of Birth',
                name: 'dob',
                allowBlank: false,
                maxValue: new Date()
            }
        ]
    }],

    buttons: [{
        text: 'Load',
        action: 'load'
    }, {
        text: 'Submit',
        disabled: true,
        formBind: true,
        action: 'submit'
    }]

 });
</pre>
<h2>View- Viewport</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
/**
 * The main application viewport, which displays the whole application
 * @extends Ext.Viewport
 */
Ext.define('ExtMVC.view.Viewport', {
    extend: 'Ext.Viewport',
    layout: 'fit',

    requires: [
        'ExtMVC.view.contact.ContactForm'
    ],

    initComponent: function() {
        var me = this;

        Ext.apply(me, {
            items: [
                {
                    xtype: 'contactform',
                    reader : Ext.create('Ext.data.reader.Xml', {
                        model: 'ExtMVC.model.Contact',
                        record : 'contact',
                        successProperty: '@success'
                    }),
                    errorReader: Ext.create('Ext.data.reader.Xml', {
                        model: 'ExtMVC.model.FieldError',
                        record : 'field',
                        successProperty: '@success'
                    })
                }
            ]
        });

        me.callParent(arguments);
    }
});
</pre>
<h2>Controller</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.controller.Contacts', {
    extend: 'Ext.app.Controller',

    models: ['Contact', 'FieldError', 'State'],

   	stores: ['States'],

    views: ['contact.ContactForm'],

    refs: [{
        ref: 'contactForm',
        selector: 'contactform'
    }],

    init: function() {

        this.control({
        	'contactform button[action=load]': {
        		click: this.loadFormData
        	},
        	'contactform button[action=submit]': {
        		click: this.submitFormData
        	}
        });
    },

    loadFormData: function() {

    	this.getContactForm().getForm().load({
            url: 'data/xml-form-data.xml',
            waitMsg: 'Loading...'
		});
	},

	submitFormData: function() {

    	this.getContactForm().getForm().submit({
            url: 'data/xml-form-errors.xml',
            submitEmptyText: false,
            waitMsg: 'Saving Data...',

            success: function(form, action) {
               Ext.Msg.alert('Success', action.result.msg);
            },
            failure: function(form, action) {
                Ext.Msg.alert('Failed', action.result ? action.result.msg : 'No response');
            }
        });
	}
});
</pre>
<h2>App.js</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.application({
    name: 'ExtMVC',

    controllers: [
        'Contacts'
    ],

    autoCreateViewport: true
});
</pre>
<h2>Página HTML</h2>
<pre class="brush: xml; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Ext JS 4 MVC Examples - loiane.com&lt;/title&gt;

	&lt;!-- Ext JS Files --&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;extjs/resources/css/ext-all.css&quot;&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;extjs/ext-debug.js&quot;&gt;&lt;/script&gt;

    &lt;!-- App Files --&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>Download do código fonte completo</h2>
<p>Você pode fazer o download do código fonte completo através dos meu repositório do Github: <a href="https://github.com/loiane/extjs4-mvc-ajax-xml-form">https://github.com/loiane/extjs4-mvc-ajax-xml-form</a></p>
<h2>Demo</h2>
<p>Para ver esse projeto rodando, acesse o link: <a href="http://loiane.com/extjs/extjs4-mvc-ajax-xml-form/" target="_blank">http://loiane.com/extjs/extjs4-mvc-ajax-xml-form/</a></p>
<h3>Todos os exemplos ExtJS 4 MVC:</h3>
<p><a href="http://www.loiane.com/2012/03/exemplos-sencha-extjs-4-em-mvc/" target="_blank">http://www.loiane.com/2012/03/exemplos-sencha-extjs-4-em-mvc/</a></p>
<p>Até o próximo exemplo! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4225&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/zW2OJxIbrgjk8gKMXH6STaXCP5I/0/da"><img src="http://feedads.g.doubleclick.net/~a/zW2OJxIbrgjk8gKMXH6STaXCP5I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/zW2OJxIbrgjk8gKMXH6STaXCP5I/1/da"><img src="http://feedads.g.doubleclick.net/~a/zW2OJxIbrgjk8gKMXH6STaXCP5I/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=UovmBd43YVk:vygEBtQqvhQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=UovmBd43YVk:vygEBtQqvhQ:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=UovmBd43YVk:vygEBtQqvhQ:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/UovmBd43YVk" height="1" width="1"/>]]></content:encoded><description>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo Ajax with XML Forms. Vamos ao código então! Estrutura do Projeto Model &amp;#8211; Contact Model &amp;#8211; FieldError Model &amp;#8211; State Store &amp;#8211; States View &amp;#8211; Form View- Viewport Controller App.js Página HTML Download do código fonte completo Você pode [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/exemplo-extjs-4-mvc-xml-ajax-form/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/exemplo-extjs-4-mvc-xml-ajax-form/</feedburner:origLink></item><item><title>DevInCachu 2012: Eu Vou (E Vou Palestrar)!</title><link>http://feedproxy.google.com/~r/Loiane/~3/p5pFKSbEuPc/</link><category>Eventos</category><category>DevInCachu</category><category>ExtJS 4</category><category>palestra</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Fri, 20 Apr 2012 00:30:42 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4334</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Oi Pessoal,</p>
<p>No mês de maio estarei em terras capixabas (minha terra natal querida!) na cidade do rei Roberto Carlos &#8211; <a href="http://pt.wikipedia.org/wiki/Cachoeiro_de_Itapemirim" target="_blank">Cachoeiro do Itapemirim</a> palestrando e participando do <a href="http://devincachu.com.br" target="_blank">Dev in Cachu</a>, evento sobre TI organizado pelo <a href="http://www.nerdes.org/" target="_blank">NERDES </a>(Grupo de Desenvolvedores do Espírito Santo).</p>
<p>O evento será realizado no dia 5 de maio (sábado) de 2012 no Centro Universitário de São Camilo, em Cachoeiro do Itapemirim.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/anuncie-devincachu1.png"><img class="aligncenter size-full wp-image-4335" title="anuncie-devincachu" src="http://www.loiane.com/wp-content/uploads/2012/04/anuncie-devincachu1.png" alt="" width="200" height="226" /></a></p>
<p>O título na minha palestra é <a href="http://devincachu.com.br/programacao/loiane-groner/desenvolvendo-aplicacoes-ria-com-extjs-4/" target="_blank">Desenvolvendo aplicações RIA com ExtJS 4</a>, então vou falar sobre ExtJS 4 em geral. Se você for ao evento e quiser que eu aborde algum tópico em específico na palestra, deixe um comentário! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>O evento conta ainda com nomes de peso do cenário de desenvolvimento brasileiro, como Paulo Silveira (<a href="http://www.caelum.com.br/" target="_blank">Caelum</a>), Franciso Souza (<a href="http://globo.com/" target="_blank">Globo.com</a>), Ronaldo Ferraz (<a href="http://www.thoughtworks.com/" target="_blank">Thoughtworks</a>), Almir Mendes (<a href="http://www.giran.com.br/" target="_blank">Giran</a>), entre outros.</p>
<p>Outra notícia é que vou levar 2 livros meus autografados para sortear no evento!</p>
<p>E quem quiser adquirir o livro, entre em contato comigo que posso levar o livro e ainda dou um desconto camarada! A entrega pode ser feita sexta feira em Vitória ou no sábado em Cachu. <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4334&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/vv9Lh4RZnHCXCBJTOzAZZ4ydWy8/0/da"><img src="http://feedads.g.doubleclick.net/~a/vv9Lh4RZnHCXCBJTOzAZZ4ydWy8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vv9Lh4RZnHCXCBJTOzAZZ4ydWy8/1/da"><img src="http://feedads.g.doubleclick.net/~a/vv9Lh4RZnHCXCBJTOzAZZ4ydWy8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=p5pFKSbEuPc:-PwqaxPFnyA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=p5pFKSbEuPc:-PwqaxPFnyA:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=p5pFKSbEuPc:-PwqaxPFnyA:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/p5pFKSbEuPc" height="1" width="1"/>]]></content:encoded><description>Oi Pessoal, No mês de maio estarei em terras capixabas (minha terra natal querida!) na cidade do rei Roberto Carlos &amp;#8211; Cachoeiro do Itapemirim palestrando e participando do Dev in Cachu, evento sobre TI organizado pelo NERDES (Grupo de Desenvolvedores do Espírito Santo). O evento será realizado no dia 5 de maio (sábado) de 2012 [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/devincachu-2012-eu-vou-e-vou-palestrar/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/devincachu-2012-eu-vou-e-vou-palestrar/</feedburner:origLink></item><item><title>[Curso de ExtJS 4] Aula 24: Data Package: Recursos Store: Sorter e Filter</title><link>http://feedproxy.google.com/~r/Loiane/~3/bUiydjpY8Gg/</link><category>Curso ExtJS 4</category><category>ExtJS</category><category>ExtJS 4</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Wed, 18 Apr 2012 17:07:39 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4318</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Vídeo/Screencast de hoje: aula 24 do curso gratuito de Ext JS 4!</p>
<p>Na aula de hoje vamos aprender como usar o sorter e o filter, dois recursos bem legais da Store.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/curso-extjs4-aula24-loiane.png"><img class="aligncenter size-full wp-image-4320" title="curso-extjs4-aula24-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/curso-extjs4-aula24-loiane.png" alt="" width="476" height="353" /></a></p>
<p>Quem quiser ver todas as aulas já publicadas, é só <a href="http://wp.me/pCF9v-Ob" target="_blank">clicar aqui</a>.</p>
<p>Espero que gostem dessa aula e fico no aguardo do feedback de vocês! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em><strong>Requerimentos:</strong></em></p>
<ul>
<li><a href="http://www.sencha.com/products/extjs/download/" target="_blank">Ext JS 4 SDK</a></li>
<li>Servidor Apache.</li>
<li>Editor de Texto (qualquer um de sua preferência). No vídeo usei o <a href="http://www.sublimetext.com/2" target="_blank">Sublime Text 2</a> (tem pra Mac OS, Windows e Linux &#8211; a versão shareware não expira!)</li>
<li>Browser (de preferência <a href="http://www.getfirefox.net/" target="_blank">Firefox </a>com Firebug ou <a href="http://www.google.com/chrome" target="_blank">Chrome</a>).</li>
<li>Php + MySQL (ou outra linguagem e banco de dados de sua preferência)</li>
</ul>
<p><em><strong>Vídeo</strong></em>:</p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/40628667" frameborder="0" width="500" height="313"></iframe></p>
<p><em><strong>Vimeo</strong></em>: <strong><a href="http://vimeo.com/loiane/curso-extjs4-aula24" target="_blank">http://vimeo.com/loiane/curso-extjs4-aula24</a></strong></p>
<p><strong><em>YouTube</em>: <a href="http://youtu.be/3DIMm2jJlKM" target="_blank">http://youtu.be/3DIMm2jJlKM</a></strong></p>
<p><em><strong>Código</strong></em>: <a href="https://github.com/loiane/curso-extjs4" target="_blank">https://github.com/loiane/curso-extjs4</a></p>
<p><em><strong>Slides:</strong></em></p>
<div id="__ss_12315981" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Curso ExtJS 4 - Aula 24: Data Package: Recursos Store: Sorter e Filter" href="http://www.slideshare.net/loianeg/curso-extjs-4-aula-24-data-package-recursos-store-sorter-e-filter" target="_blank">Curso ExtJS 4 &#8211; Aula 24: Data Package: Recursos Store: Sorter e Filter</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/12315981" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="425" height="355"></iframe></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/loianeg" target="_blank">Loiane Groner</a></div>
</div>
<p><strong style="display: block; margin: 12px 0 4px;">Até a próxima aula! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4318&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/oB99Nd5YDpIXAmZzTVNZitH3nQQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/oB99Nd5YDpIXAmZzTVNZitH3nQQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oB99Nd5YDpIXAmZzTVNZitH3nQQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/oB99Nd5YDpIXAmZzTVNZitH3nQQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=bUiydjpY8Gg:wrxGIS-mY-I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=bUiydjpY8Gg:wrxGIS-mY-I:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=bUiydjpY8Gg:wrxGIS-mY-I:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/bUiydjpY8Gg" height="1" width="1"/>]]></content:encoded><description>Vídeo/Screencast de hoje: aula 24 do curso gratuito de Ext JS 4! Na aula de hoje vamos aprender como usar o sorter e o filter, dois recursos bem legais da Store. Quem quiser ver todas as aulas já publicadas, é só clicar aqui. Espero que gostem dessa aula e fico no aguardo do feedback de vocês! [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/curso-de-extjs-4-aula-24-data-package-recursos-store-sorter-e-filter/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">9</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/curso-de-extjs-4-aula-24-data-package-recursos-store-sorter-e-filter/</feedburner:origLink></item><item><title>Meu livro ExtJS 4 First Look à venda e pronta entrega no Brasil!</title><link>http://feedproxy.google.com/~r/Loiane/~3/x-EAgSGz0Jw/</link><category>Livros</category><category>ExtJS 4 First Look</category><category>livro</category><category>loja.loiane.com</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Mon, 16 Apr 2012 00:30:52 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4292</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Olá pessoal,</p>
<p>Devido ao número de pedidos por email que vinha recebendo para comprar meu livro, decidi fazer uma lojinha para a venda para aqueles que não possuem cartão de crédito internacional ou não querem esperar quase 2 meses para o livro chegar de alguma loja gringa.</p>
<p>Fiz então o pedido de alguns livros pela amazon.com &#8211; pois a entrega é mais rápida do que pela editora; e coloquei à venda na lojinha do blog.</p>
<p>Quem quiser obter uma cópia, o livro já vai autografado e vai todo embaladinho para não amassar. O frete também é grátis para todo o Brasil e o pagamento poder ser feito por boleto ou pelo cartão de crédito via pagseguro (também pode parcelar o livro em até 18x). O preço é 100 reais (preço do livro + impostos + frete). Tentei negociar com algumas livrarias aqui no Brasil, mas eles queriam vender o livro por 150 reais e não achei o preço justo.</p>
<p>Quem quiser fazer as contas para comparar, aí vai: o preço final do livro comprando com a editora fica 58,3 dólares (preço do livro + impostos + frete) x 1.84 (cotação dólar de abril 2012) = 107,27 reais. Na lojinha o livro já está aqui no Brasil (São Paulo) e despacho em até 24 horas após confirmação do pagamento.</p>
<p>Também tem a opção do ebook (pdf + mobi + epub) e o livro vai licenciado para o seu nome, email e endereço. Neste caso apenas sou apenas uma intermediadora com a editora, toda a compra é feita em seu nome. O livro também fica disponível na biblioteca virtual da editora, e é possível ler em um leitor feito em extjs! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Bem, em breve também vou adicionar mais ebooks (em português) que vou escrever quando tiver um tempo. Gostei da experiência de escrever livro, mas quando se tem uma editora por trás é muito burocrático e você não pode fazer nada com o livro, pois o livro não é meu, apenas tenho os direitos autorais dele. Por isso os próximos vou fazer através de produção independente.</p>
<p>Bem, quem se interessar, pode acessar o link <a href="http://loja.loiane.com" target="_blank">loja.loiane.com</a>.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/loja-loiane-extjs4-livro.png"><img class="aligncenter  wp-image-4293" title="loja-loiane-extjs4-livro" src="http://www.loiane.com/wp-content/uploads/2012/04/loja-loiane-extjs4-livro.png" alt="" width="578" height="385" /></a></p>
<p>Até a próxima!</p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4292&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/ylo6gliW-gwdCueh3A2SbERygr4/0/da"><img src="http://feedads.g.doubleclick.net/~a/ylo6gliW-gwdCueh3A2SbERygr4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ylo6gliW-gwdCueh3A2SbERygr4/1/da"><img src="http://feedads.g.doubleclick.net/~a/ylo6gliW-gwdCueh3A2SbERygr4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=x-EAgSGz0Jw:yGJBjX9ezrI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=x-EAgSGz0Jw:yGJBjX9ezrI:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=x-EAgSGz0Jw:yGJBjX9ezrI:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/x-EAgSGz0Jw" height="1" width="1"/>]]></content:encoded><description>Olá pessoal, Devido ao número de pedidos por email que vinha recebendo para comprar meu livro, decidi fazer uma lojinha para a venda para aqueles que não possuem cartão de crédito internacional ou não querem esperar quase 2 meses para o livro chegar de alguma loja gringa. Fiz então o pedido de alguns livros pela [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/meu-livro-extjs-4-first-look-a-venda-e-pronta-entrega-no-brasil/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/meu-livro-extjs-4-first-look-a-venda-e-pronta-entrega-no-brasil/</feedburner:origLink></item><item><title>Exemplo ExtJS 4 MVC: Binding de Grid com Form</title><link>http://feedproxy.google.com/~r/Loiane/~3/oScINQlc62M/</link><category>Ext JS 4</category><category>ExtJS 4</category><category>ExtJS 4 MVC</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Sun, 15 Apr 2012 00:30:24 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4208</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo <a href="http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/form/form-grid.html" target="_blank">Binding a Grid to a Form</a>.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-grid-binded-form-loiane.jpg" target="_blank"><img class="aligncenter  wp-image-4264" title="extjs4-mvc-grid-binded-form-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-grid-binded-form-loiane.jpg" alt="" width="530" height="317" /></a></p>
<p>Vamos ao código então!</p>
<h2>Estrutura do Projeto</h2>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-grid-binded-form-loiane-01.png"><img class="aligncenter size-full wp-image-4303" title="extjs4-mvc-grid-binded-form-loiane-01" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-grid-binded-form-loiane-01.png" alt="" width="566" height="597" /></a></p>
<h2>Model</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('Ext4Example.model.Stock', {
	extend: 'Ext.data.Model',
	fields: [
	    {name: 'company'},
        {name: 'price',      type: 'float'},
        {name: 'change',     type: 'float'},
        {name: 'pctChange',  type: 'float'},
        {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'},
        // Rating dependent upon performance 0 = best, 2 = worst
        {name: 'rating', type: 'int', convert: function(value, record) {
            var pct = record.get('pctChange');
            if (pct &lt; 0) return 2;
            if (pct &lt; 1) return 1;
            return 0;
        }}
    ]
});
</pre>
<h2>Store</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('Ext4Example.store.Stocks', {
    extend: 'Ext.data.ArrayStore',
    model: 'Ext4Example.model.Stock',
    data: [
        ['3m Co',                               71.72, 0.02,  0.03,  '9/1 12:00am'],
        ['Alcoa Inc',                           29.01, 0.42,  1.47,  '9/1 12:00am'],
        ['Altria Group Inc',                    83.81, 0.28,  0.34,  '9/1 12:00am'],
        ['American Express Company',            52.55, 0.01,  0.02,  '9/1 12:00am'],
        ['American International Group, Inc.',  64.13, 0.31,  0.49,  '9/1 12:00am'],
        ['AT&amp;T Inc.',                           31.61, -0.48, -1.54, '9/1 12:00am'],
        ['Boeing Co.',                          75.43, 0.53,  0.71,  '9/1 12:00am'],
        ['Caterpillar Inc.',                    67.27, 0.92,  1.39,  '9/1 12:00am'],
        ['Citigroup, Inc.',                     49.37, 0.02,  0.04,  '9/1 12:00am'],
        ['E.I. du Pont de Nemours and Company', 40.48, 0.51,  1.28,  '9/1 12:00am'],
        ['Exxon Mobil Corp',                    68.1,  -0.43, -0.64, '9/1 12:00am'],
        ['General Electric Company',            34.14, -0.08, -0.23, '9/1 12:00am'],
        ['General Motors Corporation',          30.27, 1.09,  3.74,  '9/1 12:00am'],
        ['Hewlett-Packard Co.',                 36.53, -0.03, -0.08, '9/1 12:00am'],
        ['Honeywell Intl Inc',                  38.77, 0.05,  0.13,  '9/1 12:00am'],
        ['Intel Corporation',                   19.88, 0.31,  1.58,  '9/1 12:00am'],
        ['International Business Machines',     81.41, 0.44,  0.54,  '9/1 12:00am'],
        ['Johnson &amp; Johnson',                   64.72, 0.06,  0.09,  '9/1 12:00am'],
        ['JP Morgan &amp; Chase &amp; Co',              45.73, 0.07,  0.15,  '9/1 12:00am'],
        ['McDonald\'s Corporation',             36.76, 0.86,  2.40,  '9/1 12:00am'],
        ['Merck &amp; Co., Inc.',                   40.96, 0.41,  1.01,  '9/1 12:00am'],
        ['Microsoft Corporation',               25.84, 0.14,  0.54,  '9/1 12:00am'],
        ['Pfizer Inc',                          27.96, 0.4,   1.45,  '9/1 12:00am'],
        ['The Coca-Cola Company',               45.07, 0.26,  0.58,  '9/1 12:00am'],
        ['The Home Depot, Inc.',                34.64, 0.35,  1.02,  '9/1 12:00am'],
        ['The Procter &amp; Gamble Company',        61.91, 0.01,  0.02,  '9/1 12:00am'],
        ['United Technologies Corporation',     63.26, 0.55,  0.88,  '9/1 12:00am'],
        ['Verizon Communications',              35.57, 0.39,  1.11,  '9/1 12:00am'],
        ['Wal-Mart Stores, Inc.',               45.45, 0.73,  1.63,  '9/1 12:00am']
    ]
});
</pre>
<h2>View &#8211; Grid</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('Ext4Example.view.stock.StockGrid' ,{
    extend: 'Ext.grid.Panel',
    alias : 'widget.stockgrid',

    title : 'Company Data',

    /**
     * Custom function used for column renderer
     * @param {Object} val
     */
    change: function(val) {
        if (val &gt; 0) {
            return '&lt;span style=&quot;color: green;&quot;&gt;' + val + '&lt;/span&gt;';
        } else if (val &lt; 0) {
            return '&lt;span style=&quot;color: red;&quot;&gt;' + val + '&lt;/span&gt;';
        }
        return val;
    },

    /**
     * Custom function used for column renderer
     * @param {Object} val
     */
    pctChange: function(val) {
        if (val &gt; 0) {
            return '&lt;span style=&quot;color: green;&quot;&gt;' + val + '%&lt;/span&gt;';
        } else if (val &lt; 0) {
            return '&lt;span style=&quot;color: red;&quot;&gt;' + val + '%&lt;/span&gt;';
        }
        return val;
    },

    // render rating as &quot;A&quot;, &quot;B&quot; or &quot;C&quot; depending upon numeric value.
    rating: function(v) {
        if (v == 0) return &quot;A&quot;;
        if (v == 1) return &quot;B&quot;;
        if (v == 2) return &quot;C&quot;;
    },

    viewConfig: {
        stripeRows: true
    },

    initComponent: function() {

    	this.store = 'Stocks';

    	this.columns = [{
            text     : 'Company',
            flex     : 1,
            sortable : false,
            dataIndex: 'company'
        },
        {
            text     : 'Price',
            width    : 75,
            sortable : true,
            renderer : 'usMoney',
            dataIndex: 'price'
        },
        {
            text     : 'Change',
            width    : 75,
            sortable : true,
            renderer : this.change,
            dataIndex: 'change'
        },
        {
            text     : '% Change',
            width    : 75,
            sortable : true,
            renderer : this.pctChange,
            dataIndex: 'pctChange'
        },
        {
            text     : 'Last Updated',
            width    : 85,
            sortable : true,
            renderer : Ext.util.Format.dateRenderer('m/d/Y'),
            dataIndex: 'lastChange'
        },
        {
            text: 'Rating',
            width: 30,
            sortable: true,
            renderer: this.rating,
            dataIndex: 'rating'
        }];

    	this.callParent(arguments);
    }
});
</pre>
<h2>View &#8211; Form</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('Ext4Example.view.stock.StockForm' ,{
    extend: 'Ext.form.FieldSet',
    alias : 'widget.stockform',

    margin: '0 0 0 10',

    title:'Company details',

    defaults: {
        width: 240,
        labelWidth: 90
    },

    defaultType: 'textfield',

    items: [{
        fieldLabel: 'Name',
        name: 'company'
    },{
        fieldLabel: 'Price',
        name: 'price'
    },{
        fieldLabel: '% Change',
        name: 'pctChange'
    },{
        xtype: 'datefield',
        fieldLabel: 'Last Updated',
        name: 'lastChange'
    }, {
        xtype: 'radiogroup',
        fieldLabel: 'Rating',
        columns: 3,
        defaults: {
            name: 'rating' //Each radio has the same name so the browser will make sure only one is checked at once
        },
        items: [{
            inputValue: '0',
            boxLabel: 'A'
        }, {
            inputValue: '1',
            boxLabel: 'B'
        }, {
            inputValue: '2',
            boxLabel: 'C'
        }]
    }]
});
</pre>
<h2>View &#8211; Panel</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('Ext4Example.view.stock.StockPanel' ,{
    extend: 'Ext.form.Panel',
    alias : 'widget.stockpanel',

    frame: true,
    title: 'Company Data',
    bodyPadding: 5,
    layout: 'column',    // Specifies that the items will now be arranged in columns

    fieldDefaults: {
        labelAlign: 'left',
        msgTarget: 'side'
    },

    items: [{
    	xtype: 'stockgrid',
    	columnWidth: .70
    },{
    	xtype: 'stockform',
    	columnWidth: .30
    }]

});
</pre>
<h2>View- Viewport</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
/**
 * The main application viewport, which displays the whole application
 * @extends Ext.Viewport
 */
Ext.define('Ext4Example.view.Viewport', {
    extend: 'Ext.Viewport',
    layout: 'fit',

    requires: [
        'Ext4Example.view.stock.StockGrid',
        'Ext4Example.view.stock.StockForm'
    ],

    initComponent: function() {
        var me = this;

        Ext.apply(me, {
            items: [
                {
                    xtype: 'stockpanel'
                }
            ]
        });

        me.callParent(arguments);
    }
});
</pre>
<h2>Controller</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('Ext4Example.controller.Stocks', {
    extend: 'Ext.app.Controller',

    stores: ['Stocks'],

    models: ['Stock'],

    views: ['stock.StockGrid','stock.StockForm','stock.StockPanel'],

    refs: [{
        ref: 'stockForm',
        selector: 'form'
    }],

    init: function() {

        this.control({
        	'stockgrid': {
        		selectionchange: this.gridSelectionChange,
                viewready: this.onViewReady
        	}
        });
    },

    gridSelectionChange: function(model, records) {

        if (records[0]) {
             this.getStockForm().getForm().loadRecord(records[0]);
        }
    },

    onViewReady: function(grid) {
        grid.getSelectionModel().select(0);
    }
});
</pre>
<h2>App.js</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.application({
    name: 'Ext4Example',

    controllers: [
        'Stocks'
    ],

    autoCreateViewport: true
});
</pre>
<h2>Página HTML</h2>
<pre class="brush: xml; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Ext JS 4 Examples - loiane.com&lt;/title&gt;

	&lt;!-- Ext JS Files --&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;extjs/resources/css/ext-all.css&quot;&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;extjs/ext-debug.js&quot;&gt;&lt;/script&gt;

    &lt;!-- App Files --&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>Download do código fonte completo</h2>
<p>Você pode fazer o download do código fonte completo através dos meu repositório do Github: <a href="https://github.com/loiane/extjs4-mvc-grid-binded-form" target="_blank">https://github.com/loiane/extjs4-mvc-grid-binded-form</a></p>
<h2>Demo</h2>
<p>Para ver esse projeto rodando, acesse o link: <a href="http://loiane.com/extjs/extjs4-mvc-grid-binded-form" target="_blank">http://loiane.com/extjs/extjs4-mvc-grid-binded-form</a></p>
<p>Até o próximo exemplo! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4208&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/ABUNI3RpODx8zYXnPYjr_hS5BJc/0/da"><img src="http://feedads.g.doubleclick.net/~a/ABUNI3RpODx8zYXnPYjr_hS5BJc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ABUNI3RpODx8zYXnPYjr_hS5BJc/1/da"><img src="http://feedads.g.doubleclick.net/~a/ABUNI3RpODx8zYXnPYjr_hS5BJc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=oScINQlc62M:ClL0zLUrxcI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=oScINQlc62M:ClL0zLUrxcI:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=oScINQlc62M:ClL0zLUrxcI:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/oScINQlc62M" height="1" width="1"/>]]></content:encoded><description>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo Binding a Grid to a Form. Vamos ao código então! Estrutura do Projeto Model Store View &amp;#8211; Grid View &amp;#8211; Form View &amp;#8211; Panel View- Viewport Controller App.js Página HTML Download do código fonte completo Você pode fazer [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/exemplo-extjs-4-mvc-binding-de-grid-com-form/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/exemplo-extjs-4-mvc-binding-de-grid-com-form/</feedburner:origLink></item><item><title>Guia Referência Rápida HTML 5</title><link>http://feedproxy.google.com/~r/Loiane/~3/or4MpoWfel8/</link><category>HTML 5</category><category>cheat sheets</category><category>guia HTML 5</category><category>HTML</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Tue, 10 Apr 2012 00:00:37 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4182</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Olá pessoal,</p>
<p>Aproveitando que HTML 5 é um tópico super quente, resolvi postar uma tabela com a lista das tags do HTML 4 e HTML 5. A tabela abaixo lista as tags novas do HTML 5 (Versão 5), tags que continuam sendo usadas no HTML 5 (Versão 4/5) e tags que foram descontinuadas (Versão 4).</p>
<p>Fiz esse tabelinha para uso pessoal, mas resolvi compartilhar com vocês.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/HTML-5-Logotipo-Oficial.png"><img class="aligncenter  wp-image-4192" title="HTML-5-Logotipo-Oficial" src="http://www.loiane.com/wp-content/uploads/2012/04/HTML-5-Logotipo-Oficial.png" alt="" width="360" height="202" /></a></p>
<p>Fiz upload para o slideshare tb, caso alguém queira fazer download e imprimir, só baixar!</p>
<div id="__ss_12292521" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Guia Referência Rápida HTML 5" href="http://www.slideshare.net/loianeg/guia-referncia-rpida-html-5" target="_blank">Guia Referência Rápida HTML 5</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/12292521" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="425" height="355"></iframe></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/loianeg" target="_blank">Loiane Groner</a></div>
</div>
<table border="1" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="102"><strong>Tag</strong></td>
<td valign="top" width="151"><strong>Info</strong></td>
<td valign="top" width="66"><strong>Versão</strong></td>
<td valign="top" width="257"><strong>Atributos*</strong></td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;!- -&gt;</strong></td>
<td valign="top" width="151">comentário</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">nenhum</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;!doctype&gt;</strong></td>
<td valign="top" width="151">tipo de documento</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">nenhum</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;a&gt;</strong></td>
<td valign="top" width="151">hyperlink</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">href | hreflang | media | ping | rel | target | type</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;abbr&gt;</strong></td>
<td valign="top" width="151">abreviação</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;acronym&gt;</strong></td>
<td valign="top" width="151">acrônimo</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;address&gt;</strong></td>
<td valign="top" width="151">elemento endereço</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;applet&gt;</strong></td>
<td valign="top" width="151">applet</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;area&gt;</strong></td>
<td valign="top" width="151">área dentro de um mapa de imagem</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">alt | coords | href | hreflang | media | ping | rel | shape | target | type</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;article&gt;</strong></td>
<td valign="top" width="151">artigo</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;aside&gt;</strong></td>
<td valign="top" width="151">fora do fluxo principal da narrativa</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;audio&gt;</strong></td>
<td valign="top" width="151">conteúdo de som</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">autobuffer | autoplay | controls | loop | src</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;b&gt;</strong></td>
<td valign="top" width="151">texto em negrito</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;base&gt;</strong></td>
<td valign="top" width="151">url base para todos os links da página</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">href | target</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;basefont&gt;</strong></td>
<td valign="top" width="151">fonte padrão para o documento</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;bb&gt;</strong></td>
<td valign="top" width="151">comando de user agent invocado</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">type</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;bdo&gt;</strong></td>
<td valign="top" width="151">direção de exibição de texto</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">dir</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;big&gt;</strong></td>
<td valign="top" width="151">texto grande</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;blockquote&gt;</strong></td>
<td valign="top" width="151">citação longa</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">cite</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;body&gt;</strong></td>
<td valign="top" width="151">corpo da página</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;br&gt;</strong></td>
<td valign="top" width="151">quebra de linha simples</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;button&gt;</strong></td>
<td valign="top" width="151">botão</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">autofocus | disabled | form | formaction | formenctype | formmethod | formnovalidate | formtarget | name | type | value</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;canvas&gt;</strong></td>
<td valign="top" width="151">arte gráfica</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">height | width</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;caption&gt;</strong></td>
<td valign="top" width="151">legenda da tabela</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;center&gt;</strong></td>
<td valign="top" width="151">texto centralizado</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;cite&gt;</strong></td>
<td valign="top" width="151">citação</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;code&gt;</strong></td>
<td valign="top" width="151">texto de código computacional</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;col&gt;</strong></td>
<td valign="top" width="151">atributos para colunas de tabelas</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">span</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;colgroup&gt;</strong></td>
<td valign="top" width="151">grupos de colunas de tabelas</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">span</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;command&gt;</strong></td>
<td valign="top" width="151">botão de comando</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">checked | default | disabled | hidden | icon | label | radiogroup | type</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;datagrid&gt;</strong></td>
<td valign="top" width="151">dados em árvore, lista ou tabulados</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">disabled</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;datalist&gt;</strong></td>
<td valign="top" width="151">lista suspensa</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;dd&gt;</strong></td>
<td valign="top" width="151">descrição de definição</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;del&gt;</strong></td>
<td valign="top" width="151">texto suprimido</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">cite | datetime</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;details&gt;</strong></td>
<td valign="top" width="151">detalhes de um elemento</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">open</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;dialog&gt;</strong></td>
<td valign="top" width="151">diálogo (conversa)</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;dir&gt;</strong></td>
<td valign="top" width="151">listagem de diretório</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;div&gt;</strong></td>
<td valign="top" width="151">seção de um documento</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;dfn&gt;</strong></td>
<td valign="top" width="151">definição de termo</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">title</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;dl&gt;</strong></td>
<td valign="top" width="151">lista de definições</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;dt&gt;</strong></td>
<td valign="top" width="151">definição de termo em listas</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;em&gt;</strong></td>
<td valign="top" width="151">texto enfatizado</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;embed&gt;</strong></td>
<td valign="top" width="151">plugin ou conteúdo externo interativo</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">height | src | type | width</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;fieldset&gt;</strong></td>
<td valign="top" width="151">grupo de campos de formulário</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">disabled | form | name</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;figure&gt;</strong></td>
<td valign="top" width="151">grupo de conteúdo de mídia e suas legendas</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;font&gt;</strong></td>
<td valign="top" width="151">cor, tamanho e fonte de texto</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;footer&gt;</strong></td>
<td valign="top" width="151">rodapé de uma página ou seção</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;form&gt;</strong></td>
<td valign="top" width="151">formulário</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">action | data | replace | accept | accept-charset | enctype | method | target</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;frame&gt;</strong></td>
<td valign="top" width="151">sub-janela</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;frameset&gt;</strong></td>
<td valign="top" width="151">conjunto de frames</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;h1&gt; até &lt;h6&gt;</strong></td>
<td valign="top" width="151">títulos de 1 a 6</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;head&gt;</strong></td>
<td valign="top" width="151">informação sobre o documento</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">nenhum</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;header&gt;</strong></td>
<td valign="top" width="151">cabeçalho de uma seção ou página</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;hgroup&gt;</strong></td>
<td valign="top" width="151">grupo de títulos</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;hr&gt;</strong></td>
<td valign="top" width="151">linha horizontal</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;html&gt;</strong></td>
<td valign="top" width="151">documento html</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">manifest</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;i&gt;</strong></td>
<td valign="top" width="151">texto em itálico</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;iframe&gt;</strong></td>
<td valign="top" width="151">sub-janela dentro da página (frame)</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">src | name |sandbox | seamless | width | height</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;img&gt;</strong></td>
<td valign="top" width="151">imagem</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">alt | src | height | ismap | usempa | width</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;input&gt;</strong></td>
<td valign="top" width="151">campo de entrada</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">accept | alt | autocomplete | autofocus | checked | disabled | form | formaction | formenctype | formmethod | formnovalidate | formtarget | height | list | max | maxlength | min | multiple | name | pattern | placeholder | readonly | required | sizr | src | step | type | value | width</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;ins&gt;</strong></td>
<td valign="top" width="151">texto inserido</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">cite | datetime</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;isindex&gt;</strong></td>
<td valign="top" width="151">campo de entrada de linha simples</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;kbd&gt;</strong></td>
<td valign="top" width="151">texto do teclado</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;label&gt;</strong></td>
<td valign="top" width="151">etiqueta para controle de formulário</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">for</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;legend&gt;</strong></td>
<td valign="top" width="151">título para conjunto de campos</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;li&gt;</strong></td>
<td valign="top" width="151">item de lista</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">value</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;link&gt;</strong></td>
<td valign="top" width="151">refrência a recurso</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">href | rel | media | hreflang | type | sizes</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;mark&gt;</strong></td>
<td valign="top" width="151">texto marcado</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;map&gt;</strong></td>
<td valign="top" width="151">mapa de imagem</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">id</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;menu&gt;</strong></td>
<td valign="top" width="151">lista de itns de menu</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">label | type</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;meta&gt;</strong></td>
<td valign="top" width="151">meta-informação</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">charset | content | httpequiv | name</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;meter&gt;</strong></td>
<td valign="top" width="151">medição dentro de um intervalo predefinido</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">high | low | max | min | optimum | value</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;nav&gt;</strong></td>
<td valign="top" width="151">links de navegação</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;noframe&gt;</strong></td>
<td valign="top" width="151">seção de frames</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;noscript&gt;</strong></td>
<td valign="top" width="151">seção sem scripts</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">nenhum</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;object&gt;</strong></td>
<td valign="top" width="151">objeto incorporado</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">data | height | type | usermap | width | object</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;ol&gt;</strong></td>
<td valign="top" width="151">lista ordenada</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">start | reversed</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;optgroup&gt;</strong></td>
<td valign="top" width="151">grupo de opções</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">disabled | label</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;option&gt;</strong></td>
<td valign="top" width="151">opção de uma lista</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">disabled | label | selected | value</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;output&gt;</strong></td>
<td valign="top" width="151">alguns tipos de saída</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">form</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;p&gt;</strong></td>
<td valign="top" width="151">parágrafo</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;param&gt;</strong></td>
<td valign="top" width="151">parâmetro para um objeto</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">name | value</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;pre&gt;</strong></td>
<td valign="top" width="151">texto pré-formatado</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;progress&gt;</strong></td>
<td valign="top" width="151">progresso de uma tarefa de qualquer tipo</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">max | value</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;q&gt;</strong></td>
<td valign="top" width="151">citação curta</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">cite</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;ruby&gt;</strong></td>
<td valign="top" width="151">anotações ruby</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;rp&gt;</strong></td>
<td valign="top" width="151">insere parênteses em torno de um texto ruby</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;rt&gt;</strong></td>
<td valign="top" width="151">componente de texto ruby</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;s&gt;</strong></td>
<td valign="top" width="151">texto taxado</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;samp&gt;</strong></td>
<td valign="top" width="151">amostra de código computacional</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;script&gt;</strong></td>
<td valign="top" width="151">scrip</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">async | type | defer | src |charset</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;section&gt;</strong></td>
<td valign="top" width="151">seção</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">cite</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;select&gt;</strong></td>
<td valign="top" width="151">lista selecionável</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">autofocus | data | disabled | form | multiple | name</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;small&gt;</strong></td>
<td valign="top" width="151">texto pequeno</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;source&gt;</strong></td>
<td valign="top" width="151">recursos de mídia</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">media | src | type</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;span&gt;</strong></td>
<td valign="top" width="151">seção dentro do texto</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;strike&gt;</strong></td>
<td valign="top" width="151">texto taxado</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;strong&gt;</strong></td>
<td valign="top" width="151">texto em negrito</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;style&gt;</strong></td>
<td valign="top" width="151">definição de estilo</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">media | type | scoped</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;sub&gt;</strong></td>
<td valign="top" width="151">texto subscrito</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;sup&gt;</strong></td>
<td valign="top" width="151">texto sobrescrito</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;table&gt;</strong></td>
<td valign="top" width="151">tabela</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;tbody&gt;</strong></td>
<td valign="top" width="151">corpo da tabela</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;td&gt;</strong></td>
<td valign="top" width="151">célula da tabela</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">colspan | rowspan | headers</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;textarea&gt;</strong></td>
<td valign="top" width="151">área de texto</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">autofocus | cols | disabled | form | name | readonly | required | rows | maxlength | placeholder | wrap</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;tfoot&gt;</strong></td>
<td valign="top" width="151">rodapé da tabela</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;th&gt;</strong></td>
<td valign="top" width="151">cabeçalho da tabela</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">colspan | rowspan | scope</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;thead&gt;</strong></td>
<td valign="top" width="151">cabeçalho da tabela</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;time&gt;</strong></td>
<td valign="top" width="151">data / horário</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">datetime</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;title&gt;</strong></td>
<td valign="top" width="151">título do documento</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">nenhum</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;tr&gt;</strong></td>
<td valign="top" width="151">linha da tabela</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;tt&gt;</strong></td>
<td valign="top" width="151">texto monoespaçado</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;u&gt;</strong></td>
<td valign="top" width="151">texto sublinhado</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;ul&gt;</strong></td>
<td valign="top" width="151">lista sem ordenação</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;var&gt;</strong></td>
<td valign="top" width="151">variável</td>
<td valign="top" width="66">4/5</td>
<td valign="top" width="257">atributos globais**</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;video&gt;</strong></td>
<td valign="top" width="151">vídeo</td>
<td valign="top" width="66">5</td>
<td valign="top" width="257">src | pôster | autobuffer | autoplay | loop | controls | width | height</td>
</tr>
<tr>
<td valign="top" width="102"><strong>&lt;xmp&gt;</strong></td>
<td valign="top" width="151">texto pré-formatado</td>
<td valign="top" width="66">4</td>
<td valign="top" width="257">-</td>
</tr>
</thead>
</table>
<p>**atributos globais: class | contenteditable | contextmenu | dir | draggable | id| irrelevant | lang | ref | registrationmark | tabindex | template | title</p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4182&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/snwlUy_20kNzM0ALQ523xNjNvJg/0/da"><img src="http://feedads.g.doubleclick.net/~a/snwlUy_20kNzM0ALQ523xNjNvJg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/snwlUy_20kNzM0ALQ523xNjNvJg/1/da"><img src="http://feedads.g.doubleclick.net/~a/snwlUy_20kNzM0ALQ523xNjNvJg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=or4MpoWfel8:AED7UJFvDAU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=or4MpoWfel8:AED7UJFvDAU:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=or4MpoWfel8:AED7UJFvDAU:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/or4MpoWfel8" height="1" width="1"/>]]></content:encoded><description>Olá pessoal, Aproveitando que HTML 5 é um tópico super quente, resolvi postar uma tabela com a lista das tags do HTML 4 e HTML 5. A tabela abaixo lista as tags novas do HTML 5 (Versão 5), tags que continuam sendo usadas no HTML 5 (Versão 4/5) e tags que foram descontinuadas (Versão 4). [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/guia-referencia-rapida-html-5/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/guia-referencia-rapida-html-5/</feedburner:origLink></item><item><title>Debugando Aplicações ExtJS com Firebug + Illuminations for Developers</title><link>http://feedproxy.google.com/~r/Loiane/~3/osW7M_pVJRA/</link><category>Ext JS 4</category><category>Screencasts</category><category>Tutoriais</category><category>debug</category><category>Ext JS 3</category><category>ExtJS 4</category><category>firebug</category><category>Illuminations for Developers</category><category>screencast</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Wed, 04 Apr 2012 00:30:12 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=3669</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>screencast</p>
<p style="text-align: left;">Video:</p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/39597898" frameborder="0" width="500" height="313"></iframe></p>
<p>&nbsp;</p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=3669&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/PQWjUiwYGKVtVh0Qlfz5r0HfaaQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/PQWjUiwYGKVtVh0Qlfz5r0HfaaQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/PQWjUiwYGKVtVh0Qlfz5r0HfaaQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/PQWjUiwYGKVtVh0Qlfz5r0HfaaQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=osW7M_pVJRA:cA2ztC9Dpbk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=osW7M_pVJRA:cA2ztC9Dpbk:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=osW7M_pVJRA:cA2ztC9Dpbk:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/osW7M_pVJRA" height="1" width="1"/>]]></content:encoded><description>screencast Video: &amp;#160;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/debugando-aplicacoes-extjs-com-firebug-illuminations-for-developers/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/debugando-aplicacoes-extjs-com-firebug-illuminations-for-developers/</feedburner:origLink></item><item><title>[Curso de ExtJS 4] Aula 23: Data Package: JsonP Proxy</title><link>http://feedproxy.google.com/~r/Loiane/~3/zhOV_wOq1Ew/</link><category>Curso ExtJS 4</category><category>ExtJS</category><category>ExtJS 4</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Tue, 03 Apr 2012 00:30:38 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4151</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Vídeo/Screencast de hoje: aula 23 do curso gratuito de Ext JS 4!</p>
<p>Na aula de hoje vamos aprender como usar o JsonP Proxy. Vamos usar o mesmo exemplo da aula passada e vamos transformá-lo em JsonP. Vamos ver que o código do ExtJS não vai mudar muito, as mudanças maiores estão no server side &#8211; utilizamos PHP + MySQL.</p>
<p>O audio da aula ficou com alguns ruídos, mas nada que atrapalhe o entendimento do conteúdo.</p>
<p>Quem quiser ver todas as aulas já publicadas, é só <a href="http://wp.me/pCF9v-Ob" target="_blank">clicar aqui</a>.</p>
<p>Espero que gostem dessa aula e fico no aguardo do feedback de vocês! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em><strong>Requerimentos:</strong></em></p>
<ul>
<li><a href="http://www.sencha.com/products/extjs/download/" target="_blank">Ext JS 4 SDK</a></li>
<li>Servidor Apache.</li>
<li>Editor de Texto (qualquer um de sua preferência). No vídeo usei o <a href="http://www.sublimetext.com/2" target="_blank">Sublime Text 2</a> (tem pra Mac OS, Windows e Linux &#8211; a versão shareware não expira!)</li>
<li>Browser (de preferência <a href="http://www.getfirefox.net/" target="_blank">Firefox </a>com Firebug ou <a href="http://www.google.com/chrome" target="_blank">Chrome</a>).</li>
<li>Php + MySQL (ou outra linguagem e banco de dados de sua preferência)</li>
<li>Domínio diferente para fazer deploy do código server</li>
</ul>
<p><em><strong>Vídeo</strong></em>:</p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/39594867" frameborder="0" width="500" height="313"></iframe></p>
<p><em><strong>Vimeo</strong></em>: <strong><a href="http://vimeo.com/loiane/curso-extjs4-aula23" target="_blank">http://vimeo.com/loiane/curso-extjs4-aula23</a></strong></p>
<p><strong><em>YouTube</em>: <a href="http://youtu.be/VpRcRzFBh_c" target="_blank">http://youtu.be/VpRcRzFBh_c</a></strong></p>
<p><em><strong>Código</strong></em>: <a href="https://github.com/loiane/curso-extjs4" target="_blank">https://github.com/loiane/curso-extjs4</a></p>
<p><em><strong>Slides:</strong></em></p>
<div id="__ss_12248246" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Curso ExtJS 4 - Aula 23: Data Package: JsonP Proxy" href="http://www.slideshare.net/loianeg/curso-extjs-4-aula-23-data-package-jsonp-proxy">Curso ExtJS 4 &#8211; Aula 23: Data Package: JsonP Proxy</a></strong><object id="__sse12248246" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=curso-extjs4-aula23-120401162412-phpapp01&amp;stripped_title=curso-extjs-4-aula-23-data-package-jsonp-proxy&amp;userName=loianeg" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12248246" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=curso-extjs4-aula23-120401162412-phpapp01&amp;stripped_title=curso-extjs-4-aula-23-data-package-jsonp-proxy&amp;userName=loianeg" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/loianeg">Loiane Groner</a>.</div>
</div>
<p><strong style="display: block; margin: 12px 0 4px;">Até a próxima aula! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4151&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/xKuxLYLBf0ANbsipXYi3f1DB96I/0/da"><img src="http://feedads.g.doubleclick.net/~a/xKuxLYLBf0ANbsipXYi3f1DB96I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xKuxLYLBf0ANbsipXYi3f1DB96I/1/da"><img src="http://feedads.g.doubleclick.net/~a/xKuxLYLBf0ANbsipXYi3f1DB96I/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=zhOV_wOq1Ew:CByX0zLiV9Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=zhOV_wOq1Ew:CByX0zLiV9Y:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=zhOV_wOq1Ew:CByX0zLiV9Y:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/zhOV_wOq1Ew" height="1" width="1"/>]]></content:encoded><description>Vídeo/Screencast de hoje: aula 23 do curso gratuito de Ext JS 4! Na aula de hoje vamos aprender como usar o JsonP Proxy. Vamos usar o mesmo exemplo da aula passada e vamos transformá-lo em JsonP. Vamos ver que o código do ExtJS não vai mudar muito, as mudanças maiores estão no server side &amp;#8211; [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/curso-de-extjs-4-aula-23-data-package-jsonp-proxy/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">20</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/curso-de-extjs-4-aula-23-data-package-jsonp-proxy/</feedburner:origLink></item><item><title>Exemplo ExtJS 4 MVC: Paging Grid</title><link>http://feedproxy.google.com/~r/Loiane/~3/dlRSfoJemu4/</link><category>Ext JS 4</category><category>ExtJS 4</category><category>ExtJS 4 MVC</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Mon, 02 Apr 2012 00:30:54 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4131</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo <a href="http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/grid/paging.html" target="_blank">Paging Grid</a>.</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-paging-grid-loiane.png"><img class="aligncenter  wp-image-4145" title="extjs4-mvc-paging-grid-loiane" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-paging-grid-loiane.png" alt="" width="567" height="407" /></a></p>
<p>Vamos ao código então!</p>
<h2>Estrutura do Projeto</h2>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-paging-grid-loiane-01.png"><img class="aligncenter size-full wp-image-4146" title="extjs4-mvc-paging-grid-loiane-01" src="http://www.loiane.com/wp-content/uploads/2012/04/extjs4-mvc-paging-grid-loiane-01.png" alt="" width="577" height="577" /></a></p>
<h2>Model</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.ForumThread', {
    extend: 'Ext.data.Model',
    fields: [
        'title',
        'forumtitle',
        'forumid',
        'username',
        {name: 'replycount', type: 'int'},
        {name: 'lastpost', mapping: 'lastpost', type: 'date', dateFormat: 'timestamp'},
        'lastposter',
        'excerpt',
        'threadid'
    ],
    idProperty: 'threadid'
});
</pre>
<h2>Store</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.store.ForumThreads', {
    extend: 'Ext.data.Store',
    model: 'ExtMVC.model.ForumThread',
    autoLoad: true,
    remoteSort: true,
    proxy: {
        // load using script tags for cross domain, if the data in on the same domain as
        // this page, an HttpProxy would be better
        type: 'jsonp',
        url: 'http://www.sencha.com/forum/topics-browse-remote.php',
        reader: {
            root: 'topics',
            totalProperty: 'totalCount'
        },
        // sends single sort as multi parameter
        simpleSortMode: true
    },
    sorters: [{
        property: 'lastpost',
        direction: 'DESC'
    }]
});
</pre>
<h2>View &#8211; Grid</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.forumThread.ForumThreadGrid' ,{
    extend: 'Ext.grid.Panel',
    alias : 'widget.forumthreadgrid',

    requires: 'Ext.ux.PreviewPlugin',

    title : 'ExtJS.com - Browse Forums',

    disableSelection: true,

    loadMask: true,

    viewConfig: {
        id: 'gv',
        trackOver: false,
        stripeRows: false,
        plugins: [{
            ptype: 'preview',
            bodyField: 'excerpt',
            expanded: true,
            pluginId: 'preview'
        }]
    },

    // pluggable renders
    renderTopic: function(value, p, record) {
        return Ext.String.format(
            '&lt;strong&gt;&lt;a href=&quot;http://sencha.com/forum/showthread.php?t={2}&quot; target=&quot;_blank&quot;&gt;{0}&lt;/a&gt;&lt;/strong&gt;&lt;a href=&quot;http://sencha.com/forum/forumdisplay.php?f={3}&quot; target=&quot;_blank&quot;&gt;{1} Forum&lt;/a&gt;',
            value,
            record.data.forumtitle,
            record.getId(),
            record.data.forumid
        );
    },

    renderLast: function(value, p, r) {
        return Ext.String.format('{0}
by {1}', Ext.Date.dateFormat(value, 'M j, Y, g:i a'), r.get('lastposter'));
    },

    initComponent: function() {

    	this.store = 'ForumThreads';

    	this.columns = [
        {
            id: 'topic',
            text: &quot;Topic&quot;,
            dataIndex: 'title',
            flex: 1,
            renderer: this.renderTopic,
            sortable: false
        },{
            text: &quot;Author&quot;,
            dataIndex: 'username',
            width: 100,
            hidden: true,
            sortable: true
        },{
            text: &quot;Replies&quot;,
            dataIndex: 'replycount',
            width: 70,
            align: 'right',
            sortable: true
        },{
            id: 'last',
            text: &quot;Last Post&quot;,
            dataIndex: 'lastpost',
            width: 150,
            renderer: this.renderLast,
            sortable: true
        }];

         // paging bar on the bottom
        this.bbar = Ext.create('Ext.PagingToolbar', {
            store: this.store,
            displayInfo: true,
            displayMsg: 'Displaying topics {0} - {1} of {2}',
            emptyMsg: &quot;No topics to display&quot;,
            items:[
                '-', {
                xtype: 'button',
                text: 'Show Preview',
                pressed: true,
                action: 'showPreview',
                enableToggle: true
            }]
        });

    	this.callParent(arguments);
    }
 });
</pre>
<h2>View- Viewport</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
/**
 * The main application viewport, which displays the whole application
 * @extends Ext.Viewport
 */
Ext.define('ExtMVC.view.Viewport', {
    extend: 'Ext.Viewport',
    layout: 'fit',

    requires: [
        'ExtMVC.view.forumThread.ForumThreadGrid'
    ],

    initComponent: function() {
        var me = this;

        Ext.apply(me, {
            items: [
                {
                    xtype: 'forumthreadgrid'
                }
            ]
        });

        me.callParent(arguments);
    }
});
</pre>
<h2>Controller</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.controller.ForumThreads', {
    extend: 'Ext.app.Controller',

    stores: ['ForumThreads'],

    models: ['ForumThread'],

    views: ['forumThread.ForumThreadGrid'],

    init: function() {
    	this.control({
	        'forumthreadgrid button[action=showPreview]': {
	        	toggle: this.showPreview
	    	}
	    });
    },

    showPreview: function(btn, pressed){

        var preview = Ext.ComponentQuery.query('forumthreadgrid dataview')[0].plugins[0];

        preview.toggleExpanded(pressed);
    }
});
</pre>
<h2>App.js</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.application({
    name: 'ExtMVC',

    paths: { 'Ext.ux': 'extjs/ux/' },

    controllers: [
        'ForumThreads'
    ],

    autoCreateViewport: true
});
</pre>
<h2>Página HTML</h2>
<pre class="brush: xml; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Ext JS 4 MVC Examples - loiane.com&lt;/title&gt;

	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;extjs/resources/css/ext-all.css&quot;&gt;

	 &lt;style&gt;
        .x-grid-cell-topic b {
            display: block;
        }
        .x-grid-cell-topic .x-grid-cell-inner {
            white-space: normal;
        }
        .x-grid-cell-topic a {
            color: #385F95;
            text-decoration: none;
        }
        .x-grid-cell-topic a:hover {
            text-decoration:underline;
        }
		.x-grid-cell-topic .x-grid-cell-innerf {
			padding: 5px;
		}
		.x-grid-rowbody {
	        padding: 0 5px 5px 5px;
		}
    &lt;/style&gt;

    &lt;script type=&quot;text/javascript&quot; src=&quot;extjs/ext-debug.js&quot;&gt;&lt;/script&gt;

    &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h2>Download do código fonte completo</h2>
<p>Você pode fazer o download do código fonte completo através dos meu repositório do Github: <a href="https://github.com/loiane/extjs4-mvc-paging-grid" target="_blank">https://github.com/loiane/extjs4-mvc-paging-grid</a></p>
<h2>Demo</h2>
<p>Para ver esse projeto rodando, acesse o link: <a href="http://loiane.com/extjs/extjs4-mvc-paging-grid/" target="_blank">http://loiane.com/extjs/extjs4-mvc-paging-grid/</a></p>
<p>Até o próximo exemplo! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4131&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/W8w3nzrtl5xECzhoP7-GgiLx-N8/0/da"><img src="http://feedads.g.doubleclick.net/~a/W8w3nzrtl5xECzhoP7-GgiLx-N8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/W8w3nzrtl5xECzhoP7-GgiLx-N8/1/da"><img src="http://feedads.g.doubleclick.net/~a/W8w3nzrtl5xECzhoP7-GgiLx-N8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=dlRSfoJemu4:vc_vLTgP_Nk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=dlRSfoJemu4:vc_vLTgP_Nk:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=dlRSfoJemu4:vc_vLTgP_Nk:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/dlRSfoJemu4" height="1" width="1"/>]]></content:encoded><description>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo Paging Grid. Vamos ao código então! Estrutura do Projeto Model Store View &amp;#8211; Grid View- Viewport Controller App.js Página HTML Download do código fonte completo Você pode fazer o download do código fonte completo através dos meu repositório [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/04/exemplo-extjs-4-mvc-paging-grid/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><feedburner:origLink>http://www.loiane.com/2012/04/exemplo-extjs-4-mvc-paging-grid/</feedburner:origLink></item><item><title>Em Breve! Curso Java Básico Online e Gratuito!</title><link>http://feedproxy.google.com/~r/Loiane/~3/E_wbhJpGRag/</link><category>Sem categoria</category><category>curso</category><category>Curso Java</category><category>Curso Java SE</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Fri, 30 Mar 2012 06:09:41 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4075</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Em breve mais uma novidade no blog! <strong>Curso de Java Básico</strong> <span style="text-decoration: underline;">Online</span> e <span style="text-decoration: underline;">Gratuito</span> para pessoas que estão começando a programar ou querem aprender Java.</p>
<p>Fiz a enquete no twitter e facebook e vocês pediram! Em breve serão atendidos!</p>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2012/03/curso-java-basico-loiane-em-breve.png"><img class="aligncenter  wp-image-4076" title="curso-java-basico-loiane-em-breve" src="http://www.loiane.com/wp-content/uploads/2012/03/curso-java-basico-loiane-em-breve.png" alt="" width="548" height="412" /></a></p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4075&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/sAoLSU6a9Fng95U10mYAQ-fRJbA/0/da"><img src="http://feedads.g.doubleclick.net/~a/sAoLSU6a9Fng95U10mYAQ-fRJbA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/sAoLSU6a9Fng95U10mYAQ-fRJbA/1/da"><img src="http://feedads.g.doubleclick.net/~a/sAoLSU6a9Fng95U10mYAQ-fRJbA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=E_wbhJpGRag:z81k8NTlzwY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=E_wbhJpGRag:z81k8NTlzwY:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=E_wbhJpGRag:z81k8NTlzwY:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/E_wbhJpGRag" height="1" width="1"/>]]></content:encoded><description>Em breve mais uma novidade no blog! Curso de Java Básico Online e Gratuito para pessoas que estão começando a programar ou querem aprender Java. Fiz a enquete no twitter e facebook e vocês pediram! Em breve serão atendidos!</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/03/em-breve-curso-java-basico-online-e-gratuito/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">12</slash:comments><feedburner:origLink>http://www.loiane.com/2012/03/em-breve-curso-java-basico-online-e-gratuito/</feedburner:origLink></item><item><title>[Curso de ExtJS 4] Aula 22: Data Package: REST Proxy</title><link>http://feedproxy.google.com/~r/Loiane/~3/kee3Nz8kADk/</link><category>Curso ExtJS 4</category><category>ExtJS</category><category>ExtJS 4</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Wed, 28 Mar 2012 00:30:21 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=4050</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Vídeo/Screencast de hoje: aula 22 do curso gratuito de Ext JS 4!</p>
<p>Na aula de hoje vamos aprender como usar o REST Proxy. Vamos usar o mesmo exemplo da aula passada e vamos transformá-lo em REST. Vamos ver que o código do ExtJS não vai mudar muito, as mudanças maiores estão no server side &#8211; utilizamos PHP + MySQL.</p>
<p>O exemplo em PHP está bem simples, fiz um cliente REST da forma mais simples possível no PHP, devido aos meus conhecimentos limitados na linguagem. Mas pelo que pesquisei na net, existem vários frameworks PHP que dão suporte á interface REST, que são bem mais completos e mais complexos também.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/curso-extjs4-aula22-loiane.png"><img class="aligncenter size-full wp-image-4063" title="curso-extjs4-aula22-loiane" src="http://www.loiane.com/wp-content/uploads/2012/03/curso-extjs4-aula22-loiane.png" alt="" width="475" height="352" /></a></p>
<p>Quem quiser ver todas as aulas já publicadas, é só <a href="http://wp.me/pCF9v-Ob" target="_blank">clicar aqui</a>.</p>
<p>Espero que gostem dessa aula e fico no aguardo do feedback de vocês! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em><strong>Requerimentos:</strong></em></p>
<ul>
<li><a href="http://www.sencha.com/products/extjs/download/" target="_blank">Ext JS 4 SDK</a></li>
<li>Servidor Apache.</li>
<li>Editor de Texto (qualquer um de sua preferência). No vídeo usei o <a href="http://www.sublimetext.com/2" target="_blank">Sublime Text 2</a> (tem pra Mac OS, Windows e Linux &#8211; a versão shareware não expira!)</li>
<li>Browser (de preferência <a href="http://www.getfirefox.net/" target="_blank">Firefox </a>com Firebug ou <a href="http://www.google.com/chrome" target="_blank">Chrome</a>).</li>
<li>Php + MySQL (ou outra linguagem e banco de dados de sua preferência)</li>
</ul>
<p><em><strong>Vídeo</strong></em>:</p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/39310441" frameborder="0" width="500" height="313"></iframe></p>
<p><em><strong>Vimeo</strong></em>: <strong><a href="http://vimeo.com/loiane/curso-extjs4-aula22" target="_blank">http://vimeo.com/loiane/curso-extjs4-aula22</a></strong></p>
<p><strong><em>YouTube</em>: <a href="http://youtu.be/wnLpChYdcbI" target="_blank">http://youtu.be/wnLpChYdcbI</a></strong></p>
<p><em><strong>Código</strong></em>: <a href="https://github.com/loiane/curso-extjs4" target="_blank">https://github.com/loiane/curso-extjs4</a></p>
<p><em><strong>Slides:</strong></em></p>
<div id="__ss_12183853" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Curso ExtJS 4 - Aula 22: Data Package: REST Proxy" href="http://www.slideshare.net/loianeg/curso-extjs-4-aula-22-data-package-rest-proxy">Curso ExtJS 4 &#8211; Aula 22: Data Package: REST Proxy</a></strong><object id="__sse12183853" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=curso-extjs4-aula22-120327193045-phpapp02&amp;stripped_title=curso-extjs-4-aula-22-data-package-rest-proxy&amp;userName=loianeg" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12183853" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=curso-extjs4-aula22-120327193045-phpapp02&amp;stripped_title=curso-extjs-4-aula-22-data-package-rest-proxy&amp;userName=loianeg" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/loianeg">Loiane Groner</a>.</div>
</div>
<p><strong style="display: block; margin: 12px 0 4px;">Até a próxima aula! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=4050&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/92RACdCXIsDZpe4VqMCjKjpRiPg/0/da"><img src="http://feedads.g.doubleclick.net/~a/92RACdCXIsDZpe4VqMCjKjpRiPg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/92RACdCXIsDZpe4VqMCjKjpRiPg/1/da"><img src="http://feedads.g.doubleclick.net/~a/92RACdCXIsDZpe4VqMCjKjpRiPg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=kee3Nz8kADk:hSFKl0CkaAg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=kee3Nz8kADk:hSFKl0CkaAg:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=kee3Nz8kADk:hSFKl0CkaAg:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/kee3Nz8kADk" height="1" width="1"/>]]></content:encoded><description>Vídeo/Screencast de hoje: aula 22 do curso gratuito de Ext JS 4! Na aula de hoje vamos aprender como usar o REST Proxy. Vamos usar o mesmo exemplo da aula passada e vamos transformá-lo em REST. Vamos ver que o código do ExtJS não vai mudar muito, as mudanças maiores estão no server side &amp;#8211; [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/03/curso-de-extjs-4-aula-22-data-package-rest-proxy/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">10</slash:comments><feedburner:origLink>http://www.loiane.com/2012/03/curso-de-extjs-4-aula-22-data-package-rest-proxy/</feedburner:origLink></item><item><title>Testando Aplicações ExtJS 4 com Siesta</title><link>http://feedproxy.google.com/~r/Loiane/~3/E4aSoCXH0sU/</link><category>Ext JS 4</category><category>Bryntum</category><category>ExtJS</category><category>Siesta</category><category>Testes</category><category>Testes ExtJS</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Tue, 27 Mar 2012 00:30:05 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=3804</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Como desenvolvedor (a), sabemos que testes são muito importantes, pois além de confirmar (ou não) que uma funcionalidade está implementada corretamente, testes também nos dão um pouco mais de garantia, além de assegurar a qualidade do código.</p>
<p>O Jasmine é bem conhecido na área de testes para códigos escritos em JavaScript, mas quando estamos trabalhando com um framework, o código é um pouco mais complexo, e não queremos apenas testar e fazer asserts de valores, também queremos testar se o drag and drop está funcionando corretamente, além de outros recursos de componentes UI. Existe uma ferramenta que nos permite fazer esses testes de maneira bem simples e fácil, que se chama <a href="http://www.bryntum.com/products/siesta/" target="_blank">Siesta</a>. O <a href="http://www.bryntum.com/products/siesta/" target="_blank">Siesta </a>foi desenvolvido por uma empresa chamada <a href="http://www.bryntum.com/" target="_blank">Bryntum</a>, e o dono dessa empresa é muito ativo na comunidade ExtJS.</p>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/teste-extjs4-siesta-loiane.jpg"><img class="aligncenter size-full wp-image-3981" title="teste-extjs4-siesta-loiane" src="http://www.loiane.com/wp-content/uploads/2012/03/teste-extjs4-siesta-loiane.jpg" alt="" width="515" height="383" /></a></p>
<p>O Siesta suporta fazer testes com componentes UI do ExtJS, como drag and drop, editor de grid e forms, load de grids, etc; além de também permitir testar funcionalidades da nova arquitetura do ExtJS 4: o MVC.</p>
<p>Além de ExtJS, o Siesta também oferece suporte a testes para JQuery e Node.js.</p>
<p>Eu estou usando essa ferramenta há algum tempo. Logo quando lançaram uma versão beta da ferramenta, a <a href="http://www.bryntum.com/" target="_blank">Bryntum</a> me deu uma licença para testá-la (pedi gentilmente! #caradepau). Mas agora existem duas licenças: free e paga. Estou usando a versão free.</p>
<p>A ferramenta também permite a prática de TDD com ExtJS! Não é legal isso? <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>No screencast/vídeo abaixo explico um pouco sobre essa ferramenta e também faço um demo para demonstrar como é super bacana, além de explicar a diferença entra a versão free e paga.</p>
<p><strong>Vimeo:</strong></p>
<p style="text-align: center;"><iframe src="http://player.vimeo.com/video/39140008" frameborder="0" width="500" height="313"></iframe></p>
<p><strong>YouTube:</strong> <a href="http://youtu.be/x4np9VFvJTI" target="_blank">http://youtu.be/x4np9VFvJTI</a></p>
<p><strong>Slides:</strong></p>
<div id="__ss_12038015" style="width: 425px;">
<p><strong style="display: block; margin: 12px 0 4px;"><a title="Testando Aplicações ExtJS 4 com Siesta" href="http://www.slideshare.net/loianeg/testando-aplicaes-extjs-4-com-siesta" target="_blank">Testando Aplicações ExtJS 4 com Siesta</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/12038015" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="425" height="355"></iframe></p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/loianeg" target="_blank">Loiane Groner</a></div>
</div>
<p>Se você gostar do vídeo e quiser saber um pouco mais, como instalar a ferramenta, começar com os primeiros testes, deixe um feedback nos comentários desse post. Talvez possa até virar um novo curso online gratuito aqui no blog!</p>
<p>Até o próximo screencast! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=3804&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/HkH4PMriz274PS2nAkJnSbhnQ0o/0/da"><img src="http://feedads.g.doubleclick.net/~a/HkH4PMriz274PS2nAkJnSbhnQ0o/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HkH4PMriz274PS2nAkJnSbhnQ0o/1/da"><img src="http://feedads.g.doubleclick.net/~a/HkH4PMriz274PS2nAkJnSbhnQ0o/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=E4aSoCXH0sU:usxC6H8EriA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=E4aSoCXH0sU:usxC6H8EriA:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=E4aSoCXH0sU:usxC6H8EriA:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/E4aSoCXH0sU" height="1" width="1"/>]]></content:encoded><description>Como desenvolvedor (a), sabemos que testes são muito importantes, pois além de confirmar (ou não) que uma funcionalidade está implementada corretamente, testes também nos dão um pouco mais de garantia, além de assegurar a qualidade do código. O Jasmine é bem conhecido na área de testes para códigos escritos em JavaScript, mas quando estamos trabalhando [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/03/testando-aplicacoes-extjs-4-com-siesta/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><feedburner:origLink>http://www.loiane.com/2012/03/testando-aplicacoes-extjs-4-com-siesta/</feedburner:origLink></item><item><title>Exemplo ExtJS 4 MVC: XML Grid</title><link>http://feedproxy.google.com/~r/Loiane/~3/MHyekgBVCA8/</link><category>Ext JS 4</category><category>ExtJS 4</category><category>ExtJS 4 MVC</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Loiane</dc:creator><pubDate>Mon, 26 Mar 2012 00:30:45 PDT</pubDate><guid isPermaLink="false">http://www.loiane.com/?p=3950</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo <a href="http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/grid/xml-grid.html" target="_blank">XML Grid</a>.</p>
<p>Vamos ao código então!</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-3951" title="extjs4-mvc-xml-grid-loiane" src="http://www.loiane.com/wp-content/uploads/2012/03/extjs4-mvc-xml-grid-loiane.jpg" alt="" width="548" height="206" /></p>
<h2>Estrutura do Projeto</h2>
<p><a href="http://www.loiane.com/wp-content/uploads/2012/03/extjs4-mvc-xml-grid.png"><img class="aligncenter size-full wp-image-4039" title="extjs4-mvc-xml-grid" src="http://www.loiane.com/wp-content/uploads/2012/03/extjs4-mvc-xml-grid.png" alt="" width="574" height="569" /></a></p>
<h2>Model</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.model.Book',{
    extend: 'Ext.data.Model',
    fields: [
        // set up the fields mapping into the xml doc
        // The first needs mapping, the others are very basic
        {name: 'Author', mapping: 'ItemAttributes &gt; Author'},
        'Title',
        'Manufacturer',
        'ProductGroup'
    ]
});
</pre>
<h2>Store</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.store.Books', {
    extend: 'Ext.data.Store',
    model: 'ExtMVC.model.Book',
    autoLoad: true,
    proxy: {
        // load using HTTP
        type: 'ajax',
        url: 'data/sheldon.xml',
        // the return will be XML, so lets set up a reader
        reader: {
            type: 'xml',
            // records will have an &quot;Item&quot; tag
            record: 'Item',
            idProperty: 'ASIN',
            totalRecords: '@total'
        }
    }
});
</pre>
<h2>View &#8211; Grid</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.view.stock.BookGrid' ,{
    extend: 'Ext.grid.Panel',
    alias : 'widget.bookgrid',

    title : 'XML Grid',

    initComponent: function() {

    	this.store = 'Books';

    	this.columns = [{
            text: &quot;Author&quot;,
            flex: 1,
            dataIndex: 'Author',
            sortable: true
        },
        {
            text: &quot;Title&quot;,
            width: 180,
            dataIndex: 'Title',
            sortable: true
        },
        {
            text: &quot;Manufacturer&quot;,
            width: 115,
            dataIndex: 'Manufacturer',
            sortable: true
        },
        {
            text: &quot;Product Group&quot;,
            width: 100,
            dataIndex: 'ProductGroup',
            sortable: true
        }];

    	this.callParent(arguments);
    }
});
</pre>
<h2>View- Viewport</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
/**
 * The main application viewport, which displays the whole application
 * @extends Ext.Viewport
 */
Ext.define('ExtMVC.view.Viewport', {
    extend: 'Ext.Viewport',
    layout: 'fit',

    requires: [
        'ExtMVC.view.book.BookGrid'
    ],

    initComponent: function() {
        var me = this;

        Ext.apply(me, {
            items: [
                {
                    xtype: 'bookgrid'
                }
            ]
        });

        me.callParent(arguments);
    }
});
</pre>
<h2>Controller</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.define('ExtMVC.controller.Books', {
    extend: 'Ext.app.Controller',

    stores: ['Books'],

    models: ['Book'],

    views: ['book.BookGrid'],

    init: function() {

    }
});
</pre>
<h2>App.js</h2>
<pre class="brush: jscript; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
Ext.application({
    name: 'ExtMVC',

    controllers: [
        'Books'
    ],

    autoCreateViewport: true
});
</pre>
<h2>Página HTML</h2>
<pre class="brush: xml; collapse: false; first-line: 1; title: ; toolbar: true; wrap-lines: false; notranslate">
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Ext JS 4 MVC Examples - loiane.com&lt;/title&gt;

	&lt;!-- Ext JS Files --&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;extjs/resources/css/ext-all.css&quot;&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;extjs/ext-debug.js&quot;&gt;&lt;/script&gt;

    &lt;!-- App Files --&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>Download do código fonte completo</h2>
<p>Você pode fazer o download do código fonte completo através dos meu repositório do Github: <a href="https://github.com/loiane/extjs4-mvc-xml-grid" target="_blank">https://github.com/loiane/extjs4-mvc-xml-grid</a></p>
<h2>Demo</h2>
<p>Para ver esse projeto rodando, acesse o link: <a href="http://loiane.com/extjs/extjs4-mvc-xml-grid" target="_blank">http://loiane.com/extjs/extjs4-mvc-xml-grid</a></p>
<p>Até o próximo exemplo! <img src='http://www.loiane.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.loiane.com/?ak_action=api_record_view&id=3950&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/93I0JqRw-D89TpMzgCmgAuqZCDE/0/da"><img src="http://feedads.g.doubleclick.net/~a/93I0JqRw-D89TpMzgCmgAuqZCDE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/93I0JqRw-D89TpMzgCmgAuqZCDE/1/da"><img src="http://feedads.g.doubleclick.net/~a/93I0JqRw-D89TpMzgCmgAuqZCDE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Loiane?a=MHyekgBVCA8:yv0dIZILy10:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Loiane?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=MHyekgBVCA8:yv0dIZILy10:nQ_hWtDbxek"><img src="http://feeds.feedburner.com/~ff/Loiane?d=nQ_hWtDbxek" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Loiane?a=MHyekgBVCA8:yv0dIZILy10:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/Loiane?d=I9og5sOYxJI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Loiane/~4/MHyekgBVCA8" height="1" width="1"/>]]></content:encoded><description>Mais um exemplo MVC de ExtJS 4 aqui no blog. Hoje vamos ver o código do exemplo XML Grid. Vamos ao código então! Estrutura do Projeto Model Store View &amp;#8211; Grid View- Viewport Controller App.js Página HTML Download do código fonte completo Você pode fazer o download do código fonte completo através dos meu repositório [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.loiane.com/2012/03/exemplo-extjs-4-mvc-xml-grid/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">3</slash:comments><feedburner:origLink>http://www.loiane.com/2012/03/exemplo-extjs-4-mvc-xml-grid/</feedburner:origLink></item></channel></rss>

