<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ExtDesenv</title>
	<atom:link href="http://extdesenv.com.br/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://extdesenv.com.br</link>
	<description>Tudo sobre frameworks e produtos Sencha: ExtJS, Touch, Architect, Animator.</description>
	<lastBuildDate>Fri, 18 May 2012 18:52:09 +0000</lastBuildDate>
	<language>pt</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Native Mobile to Web #1: Facebook Login</title>
		<link>http://extdesenv.com.br/?p=434&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=native-mobile-to-web-1-facebook-login</link>
		<comments>http://extdesenv.com.br/?p=434&#038;lang=pt#comments</comments>
		<pubDate>Fri, 18 May 2012 18:32:16 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Sem categoria]]></category>

		<guid isPermaLink="false">http://extdesenv.com/?p=434</guid>
		<description><![CDATA[Wouldn&#8217;t be cool if we selected some native mobile UI and try to recreate them using only HTML5, CSS3 and JavaScript? So, today is Facebook&#8217;s extraordinary IPO and I took their clean &#038; classy login screen and recreated it for &#8230; <a href="http://extdesenv.com.br/?p=434&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_437" class="wp-caption aligncenter" style="width: 210px"><a href="http://extdesenv.com/wp-content/uploads/2012/05/facebook-login-ios.png"><img src="http://extdesenv.com/wp-content/uploads/2012/05/facebook-login-ios-200x300.png" alt="" title="facebook-login-ios" width="200" height="300" class="size-medium wp-image-437" /></a><p class="wp-caption-text">Original iOS Interface</p></div>
<p>Wouldn&#8217;t be cool if we selected some native mobile UI and try to recreate them using only HTML5, CSS3 and JavaScript? So, today is Facebook&#8217;s extraordinary IPO and I took their clean &#038; classy login screen and recreated it for the web! Here it is the final result, some code and also comments.</p>
<p>Disclaimer: I created this app with the iPhone Facebook App in mind. I only tested the app on iPhone. I already noticed that the radial gradient background looks pixelated on Chrome, and I also suspect that due to other gradients, alpha colors and etc this app will make some Android and BlackBerry devices scream. Please don&#8217;t blame me :)</p>
<iframe class="live-example" width="100%" style="max-width:320px;" height="480" src="http://brunotavares.github.com/SenchaExamples/touch/native-to-web-facebook-login/"></iframe>
<small class="live-example-disclaimer">*Touch compatibility webkit only</small>
<p>This view above is an iframe, if you open this blog post with Chrome or Safari you&#8217;ll be able to see it running! You can also point your mobile device to the following URL:</p>
<ul>
<li>Live Example: <a href="http://brunotavares.github.com/SenchaExamples/touch/native-to-web-facebook-login/" title="Facebook Web Login">http://brunotavares.github.com/SenchaExamples/touch/native-to-web-facebook-login/</a></li>
<li>Source code: <a href="https://github.com/brunotavares/SenchaExamples/tree/master/touch/native-to-web-facebook-login" title="Facebook Web Login">http://github.com/brunotavares/SenchaExamples/</a>
</ul>
<h1>View</h1>
<p>The view it&#8217;s pretty simple. We have the logo, 2 fields and 3 buttons. The only thing that might look different is the component with CSS class &#8216;shadow&#8217;. Since I wasn&#8217;t able to create a box-shadow for the fields without creating conflicts with their borders, I use this component as a layer on top of the fields with the inner shadow.</p>
<script src="http://gist-it.appspot.com/github/brunotavares/SenchaExamples/raw/master/touch/native-to-web-facebook-login/app/view/Login.js"></script>
<h1>Theming</h1>
<p>About the theming, there&#8217;s a lot of CSS3 stuff inside. I&#8217;m using <a href="http://sass-lang.com/" title="Sass Lang">Sass</a> with <a href="http://compass-style.org">Compass framework</a>, so it alleviates some of the hurdles of plain CSS. Logo is just a component with fixed size and a background image. I&#8217;m also providing the retina version of it using the medias queries.</p>
<p><a href="http://extdesenv.com/wp-content/uploads/2012/05/facebook-login-fields.png"><img src="http://extdesenv.com/wp-content/uploads/2012/05/facebook-login-fields.png" alt="" title="facebook-login-fields" width="567" height="187" class="aligncenter size-full wp-image-447" /></a><br />
As I wrote previously, the shadow component is a <del datetime="2012-05-18T06:42:15+00:00">hack</del> solution for making the inner box-shadow, without creating conflicts with the fields&#8217; borders. The email field has a gray border on the bottom, and the password a white border on the top. It creates kind of an edge between fields. Something different about the fields is that you can style the text placeholder using ::-webkit-input-placeholder.</p>
<p><a href="http://extdesenv.com/wp-content/uploads/2012/05/facebook-login-buttons.png"><img src="http://extdesenv.com/wp-content/uploads/2012/05/facebook-login-buttons.png" alt="" title="facebook-login-buttons" width="262" height="102" class="aligncenter size-full wp-image-449" /></a><br />
The buttons received new gradients, and also additional box-shadows. They also provide the same pressing state as the original interface.</p>
<script src="http://gist-it.appspot.com/github/brunotavares/SenchaExamples/raw/master/touch/native-to-web-facebook-login/resources/sass/app.scss"></script>
<h1>Wrapping up</h1>
<p>And that&#8217;s pretty much it. This is a great exercise, to see what we can accomplish using only web. Specially with Sencha Touch, since we hear a lot of questions asking how easy/hard it is to customize Touch components. </p>
<p>I wanted to use only CSS3, but for production it would be better to use a solid image for the radial background for non-iOS devices, and other sutil improvements. From my experience it performs way better.</p>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=434&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=434&amp;lang=pt" data-text="Native Mobile to Web #1: Facebook Login"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=434&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D434%26amp%3Blang%3Dpt&amp;linkname=Native%20Mobile%20to%20Web%20%231%3A%20Facebook%20Login" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D434%26amp%3Blang%3Dpt&amp;linkname=Native%20Mobile%20to%20Web%20%231%3A%20Facebook%20Login" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D434%26amp%3Blang%3Dpt&amp;linkname=Native%20Mobile%20to%20Web%20%231%3A%20Facebook%20Login" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D434%26amp%3Blang%3Dpt&amp;linkname=Native%20Mobile%20to%20Web%20%231%3A%20Facebook%20Login" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D434%26amp%3Blang%3Dpt&amp;linkname=Native%20Mobile%20to%20Web%20%231%3A%20Facebook%20Login" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D434%26amp%3Blang%3Dpt&amp;title=Native%20Mobile%20to%20Web%20%231%3A%20Facebook%20Login" id="wpa2a_4"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=434&#038;lang=pt</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to create a mobile Flickr app with Sencha Touch 2</title>
		<link>http://extdesenv.com.br/?p=369&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-create-a-mobile-flickr-app-with-sencha-touch-2</link>
		<comments>http://extdesenv.com.br/?p=369&#038;lang=pt#comments</comments>
		<pubDate>Wed, 16 May 2012 05:56:18 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Tutoriais]]></category>

		<guid isPermaLink="false">http://extdesenv.com/?p=369</guid>
		<description><![CDATA[Desculpe-nos, mas este texto esta apenas disponível em English. The best way for developers to learn new technology is definitely coding. For learning the new changes introduced with Touch 2, I created this little app that I called Touchr. It &#8230; <a href="http://extdesenv.com.br/?p=369&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="language_unavailable">Desculpe-nos, mas este texto esta apenas disponível em <a href="http://extdesenv.com.br/?feed=rss2">English</a>.</p>
<p>The best way for developers to learn new technology is definitely coding. For learning the new changes introduced with Touch 2, I created this little app that I called Touchr. It features some common  components and basic filtering interaction, but also a customized proxy with YQL integration to consume Flickr. Check the list:</p>
<ul>
<li>MVC architecture</li>
<li>Customized JSONP proxy that consumes YQL queries</li>
<li>Use of sencha.io service to resize images, optimizing for mobile screens.</li>
<li>Use of controller listeners to filter data stores</li>
<li>Use of TabPanel, DataView, Buttons, Toolbar, TextField</li>
<li>Use of custom theme to define new color, new icons and css optimizations</li>
</ul>
<p>In this post I&#8217;ll share some details so you can also exercise some Touch skills as well!<br />
<span id="more-369"></span></p>
<h1>Grab it!</h1>
<p>The code is available on <a href="https://github.com/brunotavares/Touchr" title="Bruno Tavares' Touchr project">github.com/brunotavares/Touchr</a>. I&#8217;m always trying to improve it and keep it up to date. The last major one was for Touch 2.1, using the new SDK with the microloader.<br />
<iframe class="live-example" width="100%" style="max-width:500px;" height="480" src="http://brunotavares.github.com/Touchr/build/production/"></iframe>
<small class="live-example-disclaimer">*Touch compatibility webkit only</small></p>
<h1>Starting the project</h1>
<pre>$ sencha app create TR ~/Code/Touchr</pre>
<p>Really simple task with the new Touch SDK. This will create all project scaffold, already activating the dynamic loading and the microloader. Check <a href="http://extdesenv.com/?p=350">&#8220;Quick Touch 2 scaffolding example&#8221;</a> if you have any questions.</p>
<h1>Views</h1>
<p>The root component for this app will be a TabPanel, and from there we&#8217;ll create 3 different lists: Feature Photos, Search Photos, and Photos from User. I decided to separate those in different views, and reference them on the tabpanel using xtype.</p>
<script src="http://gist-it.appspot.com/github/brunotavares/Touchr/raw/master/app/view/Main.js"></script>
<p>All the 3 lists will look similar. I picked the User list to expand the code. Please take a look on other 2 lists views from the repository. </p>
<p>Notice that it&#8217;s a list, but it extends Ext.dataview.DataView, and not Ext.dataview.List. Since I don&#8217;t need features like row selection, grouping, and index bar, the dataview is a lighter and better option. The same line of thought is valid when choosing simple Containers other than full Panels. Always analyse carefully when picking up components.</p>
<p>Also notice that for the <i>itemTpl</i> config I&#8217;m using the <a href="http://docs.sencha.com/io/1-0/#!/guide/src" title="Sencha Src, mobile images optimization">src.sencha.io service</a>. It&#8217;s a great utility that delivers  images according to the device screen size. It makes your app faster, since you don&#8217;t need to serve 1000&#215;600 pictures for a 480&#215;320 device.<br />
<script src="http://gist-it.appspot.com/github/brunotavares/Touchr/raw/master/app/view/user/List.js"></script></p>
<h1>Models and DataStores</h1>
<p>The list above will only display data if it&#8217;s tied to a datastore. In this case is the <i>UserPhotos</i> store. And this store is tied to the <i>Photo</i> model, which defines its fields.</p>
<p>Taking a close look at this store, it&#8217;s clear that it&#8217;s linked to <i>TR.model.Photo</i>. It&#8217;s also using <i>remoteFilter</i>, which allows the custom Flickr proxy to pass parameters to Yahoo YQL API (more to come). The proxy is the one responsible for fetching data, and it has a JSON reader attached for parsing.</p>
<p>This store features a not so conventional <i>rootProperty</i>. It&#8217;s a nested one, since the YQL API response is formatted in this way.<br />
<script src="http://gist-it.appspot.com/github/brunotavares/Touchr/raw/master/app/store/UserPhotos.js"></script></p>
<p>The <i>Photo</i> model is pretty straightforward. The only different thing here is the <i>photo_url</i> field, which is not an information delivered by the server-side. It&#8217;s a custom local property that I defined, so I could have a better model design. Since mobile apps often deal with third part APIs, and those are not always properly designed for our app, we have the chance to normalize it.<br />
<script src="http://gist-it.appspot.com/github/brunotavares/Touchr/raw/master/app/model/Photo.js"></script></p>
<h1>Controllers</h1>
<p>At this point we already have views displaying data, so now we&#8217;re adding some interaction. Let&#8217;s take a look on the search tab, which has a <i>searchfield</i> on the top that will filter our list. We need to create a controller that will look into the component tree for our <i>searchfield</i>, associate a listener to it, and then filter the list&#8217;s store.</p>
<p>The way controllers associate listeners to components is by the <i>control</i> config. This object receives key:values pairs, where the key is a string representing a <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.ComponentQuery" title="Docs for ComponentQuery Class">ComponentQuery String</a>, and the value is another object, containing the name of the event as key, and the value as a function string reference.</p>
<p>To filter the list I don&#8217;t actually go trough its methods trying to find a way to accomplish the task. All the data is defined on the datastores and models. They serve as a data layer, and every data operations as adding, removing, updating or filtering itens is done by the datastore.<br />
<script src="http://gist-it.appspot.com/github/brunotavares/Touchr/raw/master/app/controller/Search.js"></script></p>
<h1>Other parts&#8230;</h1>
<p>I&#8217;m still missing the custom Flickr Proxy, designed to consume YQL Service via JSONP, and the theming structure. I&#8217;ll let those to a separate article.</p>
<p>On this post we saw how to start the project, and go trough the MVC pattern, defining views, then the data layer with models and stores, and last adding interaction via controllers.</p>
<p>I&#8217;m looking forward to do more tutorials like these. If you like it, don&#8217;t forget to share and support our growth!</p>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=369&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=369&amp;lang=pt" data-text="How to create a mobile Flickr app with Sencha Touch 2"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=369&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D369%26amp%3Blang%3Dpt&amp;linkname=How%20to%20create%20a%20mobile%20Flickr%20app%20with%20Sencha%20Touch%202" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D369%26amp%3Blang%3Dpt&amp;linkname=How%20to%20create%20a%20mobile%20Flickr%20app%20with%20Sencha%20Touch%202" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D369%26amp%3Blang%3Dpt&amp;linkname=How%20to%20create%20a%20mobile%20Flickr%20app%20with%20Sencha%20Touch%202" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D369%26amp%3Blang%3Dpt&amp;linkname=How%20to%20create%20a%20mobile%20Flickr%20app%20with%20Sencha%20Touch%202" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D369%26amp%3Blang%3Dpt&amp;linkname=How%20to%20create%20a%20mobile%20Flickr%20app%20with%20Sencha%20Touch%202" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D369%26amp%3Blang%3Dpt&amp;title=How%20to%20create%20a%20mobile%20Flickr%20app%20with%20Sencha%20Touch%202" id="wpa2a_8"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=369&#038;lang=pt</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sencha ION Beta Sign-up</title>
		<link>http://extdesenv.com.br/?p=359&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sencha-ion-beta-sign-up</link>
		<comments>http://extdesenv.com.br/?p=359&#038;lang=pt#comments</comments>
		<pubDate>Mon, 14 May 2012 16:13:18 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Notícias]]></category>
		<category><![CDATA[ION]]></category>

		<guid isPermaLink="false">http://extdesenv.com/?p=359</guid>
		<description><![CDATA[Desculpe-nos, mas este texto esta apenas disponível em English. When Ext Designer came, everyone was exciting not only to finally put hands on this great product, but also to see an Ext JS application running natively on the desktop. As &#8230; <a href="http://extdesenv.com.br/?p=359&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="language_unavailable">Desculpe-nos, mas este texto esta apenas disponível em <a href="http://extdesenv.com.br/?feed=rss2">English</a>.</p>
<p>When Ext Designer came, everyone was exciting not only to finally put hands on this great product, but also to see an Ext JS application running natively on the desktop. As all the other curious developers, I did some research and come with the post <a href="http://extdesenv.com/?p=270">Ext ION: rumors of a new product</a>. This was back in April 2010, when I wasn&#8217;t even a Sencha employee.</p>
<p>For my surprise, my predictions were confirmed last week! Sencha announced the <a href="http://t.co/w5S8MqEJ">private beta sign-up for ION</a>. On the short description, the product is labeled as a way to wrap Ext JS Web applications in a native desktop shell.<br />
<span id="more-359"></span></p>
<blockquote><p>Sencha &#8220;ION&#8221; is a project that enables packaging of Ext JS applications in to a native desktop shell (think &#8220;PhoneGap for the Desktop&#8221; :-). We are currently interested in beta testers who are looking to deploy their web apps as desktop applications. You may be interested in doing this if you are looking to distribute your app through a System Management Service, or if you have IE6/7/8 on your corporate environment but want to take advantage of HTML5 features in your app, or many other scenarios. Sencha &#8220;ION&#8221; technology will appear in various Sencha products over the course of the next year, and this is an early opportunity to test it out and provide us with feedback on how we can make it work best for you.</p></blockquote>
<p>In my opinion the biggest impact is in organizations that are locked in old browsers. That way developers can use ION to make use of the best HTML5 features, without carrying about old browsers.</p>
<p>If you have a cool project and is willing to test it, sign up for the beta! For all the others, let&#8217;s wait some more to see what is coming!</p>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=359&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=359&amp;lang=pt" data-text="Sencha ION Beta Sign-up"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=359&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D359%26amp%3Blang%3Dpt&amp;linkname=Sencha%20ION%20Beta%20Sign-up" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D359%26amp%3Blang%3Dpt&amp;linkname=Sencha%20ION%20Beta%20Sign-up" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D359%26amp%3Blang%3Dpt&amp;linkname=Sencha%20ION%20Beta%20Sign-up" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D359%26amp%3Blang%3Dpt&amp;linkname=Sencha%20ION%20Beta%20Sign-up" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D359%26amp%3Blang%3Dpt&amp;linkname=Sencha%20ION%20Beta%20Sign-up" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D359%26amp%3Blang%3Dpt&amp;title=Sencha%20ION%20Beta%20Sign-up" id="wpa2a_12"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=359&#038;lang=pt</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Touch 2 scaffolding example</title>
		<link>http://extdesenv.com.br/?p=350&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quick-touch-2-scaffolding-example</link>
		<comments>http://extdesenv.com.br/?p=350&#038;lang=pt#comments</comments>
		<pubDate>Fri, 11 May 2012 21:54:37 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[SDK Tools]]></category>
		<category><![CDATA[Sencha Touch]]></category>

		<guid isPermaLink="false">http://extdesenv.com.br/?p=350</guid>
		<description><![CDATA[Desculpe-nos, mas este texto esta apenas disponível em English. The new Sencha Touch 2 framework ships with a terminal SDK that makes it easier than ever to create, pack and deploy your application. Let&#8217;s take a look on how we &#8230; <a href="http://extdesenv.com.br/?p=350&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="language_unavailable">Desculpe-nos, mas este texto esta apenas disponível em <a href="http://extdesenv.com.br/?feed=rss2">English</a>.</p>
<p>The new Sencha Touch 2 framework ships with a terminal SDK that makes it easier than ever to create, pack and deploy your application. Let&#8217;s take a look on how we start a brand new project with Touch 2.</p>
<p>First of all, make sure you check the official guide <a href="http://docs.sencha.com/touch/2-0/#!/guide/command">Using Sencha Command</a>. It will help you have everything setup.</p>
<p>Scaffolding a new project requires a simple command.
<pre>sencha app create &lt;namespace&gt; &lt;path_to_project&gt;</pre>
<p> The trick here is that you need to be at the sencha framework folder to execute this line. If you execute <i>sencha app create</i> from any other folder, it won&#8217;t work.<span id="more-350"></span></p>
<pre>$ cd sencha-touch-2.0.0-gpl
$ ./command/sencha app create Blog ~/Code/BlogProject
[INFO] Created file /Users/brunotavares/Code/BlogProject/.senchasdk
[INFO] Created file /Users/brunotavares/Code/BlogProject/index.html
[INFO] Created file /Users/brunotavares/Code/BlogProject/app.js
[INFO] Created file /Users/brunotavares/Code/BlogProject/packager.json
[INFO] Created file /Users/brunotavares/Code/BlogProject/app.json
[INFO] Created file /Users/brunotavares/Code/BlogProject/app/view/Main.js
[INFO] Copied dir: /Users/brunotavares/Code/BlogProject/sdk/src
[INFO] Copied dir: /Users/brunotavares/Code/BlogProject/sdk/resources
[INFO] Copied dir: /Users/brunotavares/Code/BlogProject/resources/icons
[INFO] Copied dir: /Users/brunotavares/Code/BlogProject/resources/loading
[INFO] Copied dir: /Users/brunotavares/Code/BlogProject/sdk/command
[INFO] Copied file: /Users/brunotavares/Code/BlogProject/sdk/microloader/development.js
[INFO] Copied file: /Users/brunotavares/Code/BlogProject/sdk/microloader/testing.js
[INFO] Copied file: /Users/brunotavares/Code/BlogProject/sdk/microloader/production.js
[INFO] Copied file: /Users/brunotavares/Code/BlogProject/sdk/version.txt
[INFO] Copied file: /Users/brunotavares/Code/BlogProject/sdk/sencha-touch.js
[INFO] Copied file: /Users/brunotavares/Code/BlogProject/sdk/sencha-touch-all.js
[INFO] Created file /Users/brunotavares/Code/BlogProject/resources/sass/app.scss
[INFO] Created file /Users/brunotavares/Code/BlogProject/resources/sass/config.rb
[INFO] Copied file: /Users/brunotavares/Code/BlogProject/resources/css/app.css</pre>
<p>And now you can open your local server (e.g. http://localhost/code/BlogProject/) and see a ready-to-code application.<br />
<a href="http://extdesenv.com.br/wp-content/uploads/2012/05/Screen-Shot-2012-05-11-at-2.42.19-PM.png"><img src="http://extdesenv.com.br/wp-content/uploads/2012/05/Screen-Shot-2012-05-11-at-2.42.19-PM-294x300.png" alt="" title="Sencha Touch 2 Scaffold" width="294" height="300" class="aligncenter size-medium wp-image-355" /></a></p>
<p>It&#8217;s fairly simple to start a Touch application with this kind of tool. It&#8217;s just download the framework, open the terminal, and execute one <i>app create</i> command.</p>
<p style="text-align:justify"><a href="http://extdesenv.com.br/wp-content/uploads/2012/05/Screen-Shot-2012-05-11-at-2.46.00-PM.png"><img src="http://extdesenv.com.br/wp-content/uploads/2012/05/Screen-Shot-2012-05-11-at-2.46.00-PM.png" alt="" title="Touch app structure" width="173" height="174" class="alignright size-full wp-image-359" /></a>The resulting app will have an ideal structure. It will make use of the new microloader, that under production keeps files on localstorage for better performance. It will have the MVC structure in place, that provides a solid and maintainable foundation. It will also create the packager.json file, that will help us pack this app for native iOS or Android distribution.</p>
<p>With this in place, we can now go ahead and develop some cool apps in the next posts!</p>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=350&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=350&amp;lang=pt" data-text="Quick Touch 2 scaffolding example"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=350&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D350%26amp%3Blang%3Dpt&amp;linkname=Quick%20Touch%202%20scaffolding%20example" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D350%26amp%3Blang%3Dpt&amp;linkname=Quick%20Touch%202%20scaffolding%20example" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D350%26amp%3Blang%3Dpt&amp;linkname=Quick%20Touch%202%20scaffolding%20example" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D350%26amp%3Blang%3Dpt&amp;linkname=Quick%20Touch%202%20scaffolding%20example" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D350%26amp%3Blang%3Dpt&amp;linkname=Quick%20Touch%202%20scaffolding%20example" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D350%26amp%3Blang%3Dpt&amp;title=Quick%20Touch%202%20scaffolding%20example" id="wpa2a_16"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=350&#038;lang=pt</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mudanças no ExtDesenv</title>
		<link>http://extdesenv.com.br/?p=332&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=changes-on-extdesenv</link>
		<comments>http://extdesenv.com.br/?p=332&#038;lang=pt#comments</comments>
		<pubDate>Thu, 10 May 2012 19:16:48 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Notícias]]></category>

		<guid isPermaLink="false">http://extdesenv.com.br/?p=332</guid>
		<description><![CDATA[Desculpe-nos, mas este texto esta apenas disponível em English. ExtDesenv has been a cool resource for Sencha stuff for a while, but in the last months things are going pretty slow. I definitely don&#8217;t wanna kill this project, since I &#8230; <a href="http://extdesenv.com.br/?p=332&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="language_unavailable">Desculpe-nos, mas este texto esta apenas disponível em <a href="http://extdesenv.com.br/?feed=rss2">English</a>.</p>
<p>ExtDesenv has been a cool resource for Sencha stuff for a while, but in the last months things are going pretty slow. I definitely don&#8217;t wanna kill this project, since I really enjoy blogging and sharing things, so I decided to make things more productive over here!</p>
<p>Starting now, we have a new simplified theme, with less customizations and more focus on content. I added a github integration, so sharing code and updating legacy code would be easier for me, and more readable for you. I&#8217;m also shifting the main language from Portuguese to English, solely to reach a higher audience. I&#8217;ll see in the future if I&#8217;ll do something with translations or not.</p>
<p>So, exciting things are happening here! Specially now that I&#8217;m working at Sencha, there&#8217;s a lot of questions and information that I can reach right from the source. Stay tuned!</p>
<h1>Hello Sencha Touch!</h1>
<p><span id="more-332"></span><br />
Just a small test for me if everything is working fine.<br />
<script src="http://gist-it.appspot.com/github/brunotavares/SenchaExamples/raw/master/touch/hello-world/index.html"></script>
<iframe class="live-example" width="100%" height="200px" src="http://brunotavares.github.com/SenchaExamples/touch/hello-world/index.html"></iframe>
<small class="live-example-disclaimer">*Touch compatibility webkit only</small></p>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=332&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=332&amp;lang=pt" data-text="Mudanças no ExtDesenv"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=332&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D332%26amp%3Blang%3Dpt&amp;linkname=Mudan%C3%A7as%20no%20ExtDesenv" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D332%26amp%3Blang%3Dpt&amp;linkname=Mudan%C3%A7as%20no%20ExtDesenv" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D332%26amp%3Blang%3Dpt&amp;linkname=Mudan%C3%A7as%20no%20ExtDesenv" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D332%26amp%3Blang%3Dpt&amp;linkname=Mudan%C3%A7as%20no%20ExtDesenv" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D332%26amp%3Blang%3Dpt&amp;linkname=Mudan%C3%A7as%20no%20ExtDesenv" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D332%26amp%3Blang%3Dpt&amp;title=Mudan%C3%A7as%20no%20ExtDesenv" id="wpa2a_20"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=332&#038;lang=pt</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brasileiro na Sencha</title>
		<link>http://extdesenv.com.br/?p=314&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=brasileiro-na-sencha</link>
		<comments>http://extdesenv.com.br/?p=314&#038;lang=pt#comments</comments>
		<pubDate>Thu, 22 Dec 2011 21:03:30 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Notícias]]></category>
		<category><![CDATA[Ext JS 4.0]]></category>

		<guid isPermaLink="false">http://www.extdesenv.com.br/?p=314</guid>
		<description><![CDATA[Escrevendo agora na sede da Sencha, justificando também a "pausa" nos posts aqui no ExtDesenv! <a href="http://extdesenv.com.br/?p=314&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Estimados leitores, lamento pela falta de atualizações. Nos últimos meses estive envolvido em diversos projetos, e escrever ficou de lado nos meus cronogramas. Mas tudo por um bom motivo: <strong>estou oficialmente trabalhando na Sencha</strong>! Não vou comentar aqui, para mais detalhes como tudo está ocorrendo em meu <a href="http://bruno.tavares.me/32/everyday/novos-planos-2011/">blog pessoal</a>.</p>
<div id="attachment_317" class="wp-caption aligncenter" style="width: 624px"><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/12/sencha-bruno-workstation.jpg"><img class="size-full wp-image-317" title="sencha-bruno-workstation" src="http://www.extdesenv.com.br/wp-content/uploads/2011/12/sencha-bruno-workstation.jpg" alt="" width="614" height="459" /></a><p class="wp-caption-text">O meu canto :)</p></div>
<p style="text-align: center;"><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/12/sencha.jpg"></a></p>
<p style="text-align: justify;">Como é de se imaginar, trabalhar ao lado dos &#8220;caras oficiais Ext JS&#8221; é um tanto importante para mim. Estou extremamente empenhado em participar de todos os projetos, e inclusive pude responder alguns tickets de amigos brasileiros no sistema de suporte!</p>
<p style="text-align: justify;">Dada estas circunstâncias não sei quando voltarei a escrever. Acho mais importante agora estar bem envolvido aqui, e em projetos open-source no GitHub. Mas não se sintam desamparados, têm uma galera muito boa na nossa comunidade brasileira! <a href="http://www.extjs.com.br/forum">www.extjs.com.br/forum</a>, o nosso fórum brasileiro de Ext segue à todo vapor, e eu ainda participo quando posso.</p>
<p style="text-align: justify;">Destaque ainda para a Loiane Groner, que está fazendo um trabalho minucioso no seu <a href="http://www.loiane.com/2011/11/curso-de-extjs-4-gratuito/">Curso Grátis de Ext JS 4</a>. Se escrever artigos em blog com imagens, exemplos e afins é difícil, imagina fazer vídeo-aulas em um curso completo! Uma iniciativa surpreendente que merece muito reconhecimento.</p>
<p style="text-align: justify;"><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/12/curso-extjs4-loiane-gratis.png"><img class="aligncenter size-full wp-image-316" title="curso-extjs4-loiane-gratis" src="http://www.extdesenv.com.br/wp-content/uploads/2011/12/curso-extjs4-loiane-gratis.png" alt="" width="210" height="236" /></a></p>
<p style="text-align: justify;">E ainda, tenho percebido que os cursos Ext JS e Sencha Touch pagos estão aparecendo &#8220;aqui e ali&#8221;. A comunidade têm amadurecido bastante, muito bom ver (e participar) de tudo isto!</p>
<p style="text-align: justify;">Ainda estou por aqui! Ainda desenvolvo com Ext (mais do que nunca), e ainda participo da comunidade. Precisando, só dar um toque ;] Abs!</p>
<p style="text-align: justify;">Bruno Tavares, <span style="color: #999999;">Solutions Engineer<br />
</span><strong><span style="color: #006600;">Sencha, Inc.</span></strong></p>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=314&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=314&amp;lang=pt" data-text="Brasileiro na Sencha"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=314&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D314%26amp%3Blang%3Dpt&amp;linkname=Brasileiro%20na%20Sencha" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D314%26amp%3Blang%3Dpt&amp;linkname=Brasileiro%20na%20Sencha" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D314%26amp%3Blang%3Dpt&amp;linkname=Brasileiro%20na%20Sencha" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D314%26amp%3Blang%3Dpt&amp;linkname=Brasileiro%20na%20Sencha" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D314%26amp%3Blang%3Dpt&amp;linkname=Brasileiro%20na%20Sencha" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D314%26amp%3Blang%3Dpt&amp;title=Brasileiro%20na%20Sencha" id="wpa2a_22"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=314&#038;lang=pt</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Construindo um aplicativo com Ext 4 &#8211; Parte 2</title>
		<link>http://extdesenv.com.br/?p=310&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=construindo-um-aplicativo-com-ext-4-parte-2</link>
		<comments>http://extdesenv.com.br/?p=310&#038;lang=pt#comments</comments>
		<pubDate>Sat, 01 Oct 2011 14:08:50 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[Exemplos]]></category>
		<category><![CDATA[Ext JS 4.0]]></category>
		<category><![CDATA[Material de Estudo]]></category>

		<guid isPermaLink="false">http://www.extdesenv.com.br/?p=310</guid>
		<description><![CDATA[Confira como criar Models, Stores, Views e Controllers no novo padrão Ext 4! <a href="http://extdesenv.com.br/?p=310&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">No <a href="http://www.extdesenv.com.br/tutoriais-estudos/construindo-um-aplicativo-com-ext-4-parte-1/">post anterior</a> iniciamos a estrutura da nossa aplicação de blog. Agora vamos ver melhor a respeito da arquitetura MVC do Ext JS 4.</p>
<h1>Model</h1>
<p style="text-align:justify;"><strong>1. Criar model no arquivo <code>app/model/Post.js</code></strong></p>
<p>[javascript]Ext.define(&#8216;EB.model.Post&#8217;, {<br />
    extend: &#8216;Ext.data.Model&#8217;,<br />
    fields: [<br />
        {name: 'id',		type: 'int'     },<br />
        {name: 'title',		type: 'string'  },<br />
        {name: 'content',	type: 'string'  }<br />
    ],<br />
	proxy: {<br />
		type: &#8216;ajax&#8217;,<br />
        url: &#8216;data/posts.json&#8217;,<br />
        reader: {<br />
            type: &#8216;json&#8217;,<br />
			root: &#8216;posts&#8217;,<br />
			idProperty: &#8216;id&#8217;<br />
        }<br />
    }<br />
});[/javascript]</p>
<p style="text-align:justify;"><strong>2. Criar store no arquivo <code>app/store/Posts.js</code></strong></p>
<p>[javascript]Ext.define(&#8216;EB.store.Posts&#8217;, {<br />
    extend      : &#8216;Ext.data.Store&#8217;,<br />
    model       : &#8216;EB.model.Post&#8217;<br />
});[/javascript]</p>
<p style="text-align:justify;"><strong>3. Criar dados fictícios no arquivo <code>data/posts.json</code></strong></p>
<p>[javascript]{<br />
	&quot;posts&quot;: [<br />
		{&quot;id&quot;:1, &quot;title&quot;: &quot;Post 1&quot;, &quot;content&quot;: &quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id nisl tellus, nec pretium tortor. Duis luctus posuere felis vitae viverra. Vivamus nisl purus, pulvinar eget rhoncus et, mattis nec leo. Donec sagittis ultrices molestie. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.&quot;},<br />
		{&quot;id&quot;:2, &quot;title&quot;: &quot;Post 2&quot;, &quot;content&quot;: &quot;In hac habitasse platea dictumst. Nam commodo, augue id consequat ultricies, lacus augue pharetra odio, in aliquet neque magna vitae ipsum. Praesent porta dictum nibh, quis aliquam tortor volutpat nec. Nulla egestas nibh ac neque congue eu commodo dui elementum. Sed interdum massa sit amet odio aliquet at blandit mauris condimentum.&quot;},<br />
		{&quot;id&quot;:3, &quot;title&quot;: &quot;Post 3&quot;, &quot;content&quot;: &quot;Vestibulum commodo pellentesque sagittis. Nullam sed venenatis mi. Etiam convallis turpis at velit faucibus lobortis. Sed pretium viverra dui vitae adipiscing. Quisque mattis mollis lectus. Nullam a convallis sapien. Donec vitae eleifend ipsum. Nam tortor ipsum, ultrices eget feugiat nec, sodales et magna.&quot;}<br />
	]<br />
}[/javascript]</p>
<p style="text-align:justify;">Fazendo desta forma a nossa camada de dados está pronta. Temos um model, aonde descrevemos os campos que o compõem, e o <code>proxy</code> que fará a conexão com o servidor. Definimos também o <code>reader</code>, que é o responsável por traduzir os dados que vêm do servidor para que o Ext possa criar as instâncias do model.</p>
<h1>View</h1>
<p style="text-align:justify;">Agora vamos criar a listagem de posts, no arquivo  <code>app/view/post/List.js</code></strong></p>
<p>[javascript]Ext.define(&#8216;EB.view.post.List&#8217;,{<br />
    extend  : &#8216;Ext.view.View&#8217;,<br />
    alias   : &#8216;widget.postlist&#8217;,</p>
<p>//inits<br />
    initComponent: function()<br />
    {<br />
        Ext.apply(this,{<br />
			title		: &#8216;Posts&#8217;,<br />
			store		: &#8216;Posts&#8217;,<br />
			itemSelector: &#8216;div.post-wrap&#8217;,<br />
			tpl			: new Ext.XTemplate(<br />
			    &#8216;&lt;tpl for=&quot;.&quot;&gt;&#8217;,<br />
					&#8216;&lt;div style=&quot;margin-bottom: 10px;&quot; class=&quot;post-wrap&quot;&gt;&#8217;,<br />
						&#8216;&lt;h2&gt;{title}&lt;/h2&gt;&#8217;,<br />
						&#8216;&lt;p&gt;{content}&lt;/p&gt;&#8217;,<br />
			        &#8216;&lt;/div&gt;&#8217;,<br />
			    &#8216;&lt;/tpl&gt;&#8217;<br />
			)<br />
		});</p>
<p>		this.callParent(arguments);<br />
		this.store.load();<br />
    }<br />
});[/javascript]</p>
<p style="text-align:justify;"><code>EB.view.post.List</code> é uma view bem simples. Ela extende de <code>Ext.view.View</code>, definindo o store e também o template utilizado para essa listagem. Vamos deixar os links de edição e exlusão de fora por enquanto.</p>
<h1>Controller</h1>
<p style="text-align:justify;">Este é a parte responsável por juntar models, stores, views, e adicionar os eventos e interações. Por enquanto não vamos definir os eventos, vamos só criar o arquivo <code>app/controller/Posts.js</code> e juntar todas as partes</p>
<p>[javascript]Ext.define(&#8216;EB.controller.Posts&#8217;, {<br />
    extend  : &#8216;Ext.app.Controller&#8217;,<br />
    views   : ['post.List'],<br />
    models  : ['Post'],<br />
	stores	: ['Posts']<br />
});[/javascript]</p>
<h1>Unindo as partes</h1>
<p style="text-align:justify;">Vamos adicionar o controller <code>Posts</code> à nossa definição de <code>application</code> em <code>app.js</code></p>
<p>[javascript]Ext.application({<br />
    name: &#8216;EB&#8217;,					//app namespace (from ExtBlog)<br />
    controllers: ['Posts'],		//here goes the controllers<br />
    autoCreateViewport: true	//automatically creates Viewport<br />
});[/javascript]</p>
<p style="text-align:justify;">O <code>app.js</code> é nosso arquivo de entrada. Ele irá disparar o carregamento de controller definido em <code>app/controller/Posts.js</code>. Como dentro do nosso controller nós indicamos suas views, models e stores envolvidas, estes também serão carregados. No final temos tudo carregado e pronto para o uso!</p>
</p>
<p style="text-align:justify;">Basta agora adicionar nossa listagem de posts ao Viewport, usando diretamente o alias <code>postlist</code></p>
<p>[javascript]//&#8230;<br />
	xtype: &#8216;tabpanel&#8217;,<br />
	region: &#8216;center&#8217;,<br />
	items: [{<br />
		xtype: 'postlist'<br />
	},{<br />
		title: 'Post 1',<br />
		html: '...post 1...'<br />
	}]<br />
//&#8230;[/javascript]</p>
<p style="text-align:justify;">Como resultado já podemos ver nossa listagem de arquivos sendo carregada. A estrutura MVC do Ext 4 permite que cada diferente parte de uma interface seja definida no seu devido lugar.</p>
<p><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/10/extblog_layout_2.jpg"><img src="http://www.extdesenv.com.br/wp-content/uploads/2011/10/extblog_layout_2.jpg" alt="" title="extblog_layout_2" width="600" height="291" class="alignnone size-full wp-image-311" /></a></p>
<p style="text-align:justify;">Apesar de termos já uma listagem, ainda falta interação para abrir o post e também as regras SASS para deixar a interface do jeito que queremos. Tudo isso será feito no próximo post!</p>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=310&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=310&amp;lang=pt" data-text="Construindo um aplicativo com Ext 4 &#8211; Parte 2"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=310&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D310%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%202" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D310%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%202" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D310%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%202" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D310%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%202" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D310%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%202" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D310%26amp%3Blang%3Dpt&amp;title=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%202" id="wpa2a_24"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=310&#038;lang=pt</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Construindo um aplicativo com Ext 4 &#8211; Parte 1</title>
		<link>http://extdesenv.com.br/?p=299&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=construindo-um-aplicativo-com-ext-4-parte-1</link>
		<comments>http://extdesenv.com.br/?p=299&#038;lang=pt#comments</comments>
		<pubDate>Thu, 26 May 2011 21:06:53 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[Exemplos]]></category>
		<category><![CDATA[Ext JS 4.0]]></category>
		<category><![CDATA[Material de Estudo]]></category>

		<guid isPermaLink="false">http://www.extdesenv.com.br/?p=299</guid>
		<description><![CDATA[Passo-a-passo de como criar um aplicativo com Ext JS 4, iniciando pela estruturação e setup do projeto! <a href="http://extdesenv.com.br/?p=299&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Demorei um pouco pra ter um contato significativo com essa nova versão por causa de várias tarefas, mas agora que estou neste ponto, acho útil compartilhar experiências com a comunidade. Este post é dedicado a todos que, assim como eu, estão passando pela transição Ext 3 &#8211; 4, e precisam ficar procurando na documentação, nos fóruns e na web como um todo, por material de estudo e explicações para problemas simples.</p>
<p style="text-align:justify;">Para ficar bem elucidado, vou criar uma aplicação simples de Blog. O sistema final deve ser parecido com o rascunho abaixo. Ele é composto de um painel para ler posts, e um menu lateral com recursos adicionais. Ao clicar em um post ele ganhará destaque, e links para edição e remoção serão mostrados. Ao clicar duas vezes uma nova aba será aberta. Na lateral poderemos filtrar por categoria ou data, e ainda teremos a opção de criar um novo post, o que abrirá uma nova janela. Apesar de ser um sistema básico, consigo através dele abordar os componentes mais usados.</p>
<p><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/05/extblog-mockupt.png"><img src="http://www.extdesenv.com.br/wp-content/uploads/2011/05/extblog-mockupt.png" alt="" title="extblog mockup" width="600" height="313" class="aligncenter size-full wp-image-305" /></a></p>
<h1>Set Up</h1>
<p><b>1. Criar a estrutura de diretórios conforme especificado na documentação oficial</b></p>
<div id="attachment_309" class="wp-caption alignright" style="width: 179px"><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/05/extjs_4_folder_structure.gif"><img src="http://www.extdesenv.com.br/wp-content/uploads/2011/05/extjs_4_folder_structure.gif" alt="" title="extjs_4_folder_structure" width="169" height="304" class="size-full wp-image-309" /></a><p class="wp-caption-text">Estrutura Diretórios</p></div>
<p style="text-align:justify;">O diretório principal recebe o nome que você desejar (algo relacionado a sua aplicação obviamente). No meu caso vou chamar de <code>extblog</code>, por esse projeto se tratar de um blog escrito em Ext. O diretório <code>extblog/app,</code> e seus subdiretórios <code>controller</code>, <code>model</code>, <code>store</code> e <code>view</code> são padrões do Ext. Temos ainda o diretório <code>extblog/ext-4.0</code>, com os fontes do Ext (não todos! Eu por enquanto estou copiando só o <code>ext.js</code>, <code>ext-dev.js</code>, e os subdiretórios <code>src</code> e <code>resources</code>). E por fim o diretório <code>extblog/resources</code> aonde colocamos arquivos estáticos como imagens e SASS</p>
<p style="clear:both;"><b>2. Criar os arquivos de entrada index.html e app.js</b></p>
<p style="text-align:justify;">O nosso arquivo <code>index.html</code> não tem muito segredo. Ele vai ser o mais simples possível, contendo somente a inclusão do arquivo CSS do Ext, o próprio JS do Ext, e um arquivo chamado <code>app.js</code>.</p>
<p>[html]&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;ExtBlog&lt;/title&gt;<br />
    &lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;<br />
    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ext-4.0/resources/css/ext-all.css&quot;&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;ext-4.0/ext-dev.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;&lt;/body&gt;<br />
&lt;/html&gt;[/html]</p>
<p><code>app.js</code> é uma novidade da versão 4. Ele é o arquivo de entrada padrão, contendo dados a respeito da inicialização da sua aplicação. Nele você informa o namespace da sua aplicação, e também quais os controllers existentes. Por enquanto só vou ter o namespace.</p>
<p>[javascript]Ext.Loader.setPath(&#8216;Ext&#8217;, &#8216;ext-4.0/src&#8217;);<br />
Ext.Loader.setConfig({enabled: true});</p>
<p>Ext.application({<br />
    name: &#8216;EB&#8217;,			//app namespace (from ExtBlog)<br />
    controllers: []		//here goes the controllers<br />
});[/javascript]</p>
<p style="text-align:justify;">Fazendo essa definição inicial já é possível acessar o aplicativo e verificar pelo firebug que tudo está sendo carregado corretamente.</p>
<p style="text-align:justify;">Como estamos utilizando a versão de desenvolvimento do Ext (ext-dev.js), é importante dizer aonde os arquivos se encontram, e também ativar o carregamento dinâmico. Isso ocorre nas 2 primeiras linhas, usando <code>Ext.Loader</code></p>
<p style="text-align:justify;">O sistema de carregamento dinâmico permite que somente as classes que realmente estão sendo utilizadas pela nossa aplicação sejam usadas. Quando chegarmos no processo de deploy, iremos utilizar a ferramenta Sencha SDK para concatenar e compactar todos arquivos em um único. Por causa desse carregamento dinâmico é temos alguns outros arquivos JS que não incluímos no HTML sendo carregados.</p>
<a href="http://www.extdesenv.com.br/wp-content/uploads/2011/05/extblog_init_firebug.gif"><img src="http://www.extdesenv.com.br/wp-content/uploads/2011/05/extblog_init_firebug.gif" alt="" title="extblog_init_firebug" width="600" height="188" class="aligncenter size-full wp-image-302" /></a>
<h1 style="margin-top:10px;">Viewport</h1>
<p style="text-align:justify;">Agora que temos o nosso projeto rodando, podemos começar a desenvolver a interface, criando o Viewport. <code>Ext.Application</code> possui uma configuração <code>autoCreateViewport</code>. Quando true, o Ext procura o arquivo <code>Viewport.js</code> e já o instancia. Então o que faremos é adicionar essa configuração em <code>app.js</code> e criar o arquivo <code>app/view/Viewport.js</code>.</p>
<p>[javascript]Ext.define(&#8216;EB.view.Viewport&#8217;, {<br />
    extend: &#8216;Ext.container.Viewport&#8217;,</p>
<p>	layout: &#8216;border&#8217;,<br />
	padding: 5,</p>
<p>	items: [{<br />
		xtype: 'container',<br />
		html: 'ExtBlog by Bruno Tavares',<br />
		region: 'north',<br />
		height:40<br />
	},{<br />
		xtype: 'tabpanel',<br />
		region: 'center',<br />
		items: [{<br />
			title: 'Posts',<br />
			html: '...here goes the posts...'<br />
		},{<br />
			title: 'Post 1',<br />
			html: '...post 1...'<br />
		}]<br />
	},{<br />
		xtype: &#8216;panel&#8217;,<br />
		region: &#8216;east&#8217;,<br />
		html: &#8216;&#8230;here goes additional resources&#8230;&#8217;,<br />
		split: true,<br />
		width: 400<br />
	}]<br />
});[/javascript]</p>
<p style="text-align:justify;">Nessa primeira classe já é possível visualizar a nova sintaxe do Ext 4; a classe é definida por <code>Ext.define</code>.</p>
<p style="text-align:justify;">Se você seguiu tudo certinho até aqui, ao tentar visualizar o viewport no navegador, pode perceber algumas mensagens de aviso como estas:</p>
<div id="attachment_304" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/05/firebug_ext_requires.gif"><img src="http://www.extdesenv.com.br/wp-content/uploads/2011/05/firebug_ext_requires.gif" alt="" title="firebug_ext_requires" width="550" height="210" class="size-full wp-image-304" /></a><p class="wp-caption-text">Aviso: você esqueceu uma dependência...</p></div>
<p style="text-align:justify;">Por causa do carregamento dinâmico, devemos informar quais as classes que nossas interfaces fazem uso. Não se preocupe se você esquecer alguma dependência enquanto desenvolve, ou não souber delas. O Ext vai carregar ela de forma síncrona e emitir este aviso no console de depuração. Para isso seu navegador deve possuir este recurso (sugiro firefox + firebug), e você deve estar utilizando a versão <code>-dev.js</code> do Ext.</p>
<p style="text-align:justify;">Para resolver com isto, basta ir adicionando os requisitos em <code>app.js</code></p>
<p>[javascript]Ext.Loader.setPath(&#8216;Ext&#8217;, &#8216;ext-4.0/src&#8217;);<br />
Ext.Loader.setConfig({enabled: true});</p>
<p>Ext.require(<br />
	&#8216;Ext.layout.container.Border&#8217;,<br />
	&#8216;Ext.tab.Panel&#8217;<br />
);</p>
<p>Ext.application({<br />
    name: &#8216;EB&#8217;,					//app namespace (from ExtBlog)<br />
    models: [],					//here goes the models<br />
    controllers: [],			//here goes the controllers<br />
    autoCreateViewport: true	//automatically creates Viewport<br />
});[/javascript]</p>
<h1>No próximo post</h1>
<p style="text-align:justify;">No próximo post (<a href="http://www.extdesenv.com.br/tutoriais-estudos/construindo-um-aplicativo-com-ext-4-parte-2/">Construindo um aplicativo com Ext 4 – Parte 2</a>) vamos criar nossos models, view e controllers. Ficamos por aqui com o setup básico de um projeto em Ext 4, já conseguindo visualizar a estrutura básica do sistema. Segue também link para download dos fontes e exemplo online. Até em breve!</p>
<p><a href="http://www.extdesenv.com.br/examples/extblog1/index.html"><img src="http://www.extdesenv.com.br/wp-content/uploads/2011/05/extblog_layout.gif" alt="" title="ver exemplo online" width="600" height="291" class="aligncenter size-full wp-image-306" /></a></p>
<div id="attachment_88" class="wp-caption aligncenter" style="width: 115px"><a href="http://www.extdesenv.com.br/examples/extblog1/extblog.zip"><img class="size-full wp-image-88" title="download" src="http://www.extdesenv.com.br/wp-content/uploads/2009/09/download.png" alt="server-side.zip" width="105" height="42" /></a><p class="wp-caption-text">Código Completo</p></div>
<div id="attachment_100" class="wp-caption aligncenter" style="width: 115px"><a href="http://www.extdesenv.com.br/examples/extblog1/index.html"><img class="size-full wp-image-100" title="demo-online" src="http://www.extdesenv.com.br/wp-content/uploads/2009/09/demo-online.png" alt="Demo Online" width="105" height="42" /></a><p class="wp-caption-text">Demo Online</p></div>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=299&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=299&amp;lang=pt" data-text="Construindo um aplicativo com Ext 4 &#8211; Parte 1"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=299&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D299%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%201" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D299%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%201" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D299%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%201" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D299%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%201" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D299%26amp%3Blang%3Dpt&amp;linkname=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%201" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D299%26amp%3Blang%3Dpt&amp;title=Construindo%20um%20aplicativo%20com%20Ext%204%20%E2%80%93%20Parte%201" id="wpa2a_26"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=299&#038;lang=pt</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>Novo sistema de classes Ext 4.0</title>
		<link>http://extdesenv.com.br/?p=296&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=novo-sistema-de-classes-ext-4-0</link>
		<comments>http://extdesenv.com.br/?p=296&#038;lang=pt#comments</comments>
		<pubDate>Sun, 01 May 2011 01:50:24 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Tutoriais]]></category>
		<category><![CDATA[Ext JS 4.0]]></category>
		<category><![CDATA[Material de Estudo]]></category>

		<guid isPermaLink="false">http://www.extdesenv.com.br/?p=296</guid>
		<description><![CDATA[Pela primeira vez na história, Ext JS passou por uma grande refatoração desde a base de seu sistema de classes. Saiba aqui o que mudou! <a href="http://extdesenv.com.br/?p=296&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify";>Iniciando uma série de posts sobre o novo Ext 4.0 não poderia começar por nada além do código mais básico do Ext, o sistema de classes. Pela primeira vez na história, a grande refatoração iniciou desde os fundamentos do framework, melhorando 100% o código anterior. As classes estão melhor estruturadas, com uma divisão mais clara entre atributos estáticos, objetos de configuração e métodos. Estão também mais fáceis de desenvolver, testar e executar. E com certeza melhores de manter.</p>
<blockquote><p style="text-align:justify";>JavaScript é uma linguagem orientada em prototipagem, sem classes. Assim, por natureza, uma das características mais marcantes da linguagem é a flexibilidade. É possível obter um mesmo resultado por diferentes maneiras, em diferentes estilos de codificação e técnicas. Essa característica, entretanto, vêm com o preço da imprevisibilidade. Sem uma estrutura unificada, código Javascript pode ser muito difícil de entender, manter e reutilizar.</p>
<p style="text-align:justify";>Programação baseada em classes, em outro extremo, continua como o modelo mais popular de POO. Linguagens baseadas em classes geralmente requerem forte tipagem, provêm encapsulamento, e possuem padrões e convenções de código. Por geralmente fazer desenvolvedores aderirem a um grande número de princípios, o código escrito tende a ser mais previsível, extensível, e escalável ao longo do tempo. Entretanto, elas não possuem a mesma capacidade dinâmica encontrada em linguagens como Javascript.</p>
<p style="text-align:justify";>Cada abordagem possui seus prós e contras, mas será que podemos ter os prós de ambas ao mesmo tempo, enquanto conciliamos os contras? A resposta é sim, e nós implementamos a solução no Ext JS 4.</p>
</blockquote>
<p><a href="http://dev.sencha.com/deploy/ext-4.0.0/docs/guide/class_system.html" style="float:right;">- Ext JS Documentation, Class System</a></p>
<h2 style="clear:both;">Convenção de Código</h2>
<p style="text-align:justify";>Para manter um padrão de codificação foram publicadas as convenções de código que devem ser adotadas pelos programadores Ext. Isto não torna o código mais rápido, mas com certeza o torna melhor, mais fácil de dar manutenção e de entender. Vou tentar citar as principais, uma lista completa e detalhada encontra-se no guia <a href="http://dev.sencha.com/deploy/ext-4.0.0/docs/guide/class_system.html">Class System</a>.</p>
<h3>Classes</h3>
<p style="text-align:justify";>Devem conter somente caracteres alfanuméricos, sendo que números devem ser evitados, a menos que pertençam a termo técnico.</p>
<p><code>Btti.util.Base64</code> é aceitável</p>
<p style="text-align:justify";>As classes devem ser organizadas em pacotes, mantendo somente 1 nome para o pacote de mais alto nível. Só o pacote de mais alto nível e o nome da classe devem ser CamelCase, o restante é minúsculo</p>
<p><code>Btti.data.SQLProxy</code></p>
<p><code>Btti.Viewport</code></p>
<p>Acrônimos também devem seguir o padrão CamelCase</p>
<p><code>Ext.data.JsonProxy</code> ao invés de <code>Ext.data.JSONProxy</code></p>
<p><code>MyCompany.util.HtmlParser</code> ao invés de <code>MyCompary.parser.HTMLParser</code></p>
<h3>Arquivos Fonte</h3>
<p style="text-align:justify";>O nome das classes mapeiam diretamente para o caminho aonde os arquivos são armazenados, como resultado deve existir somente 1 classe por arquivo. Exemplo:</p>
<p><code>Ext.util.Observable</code> é armazenado em <code>path/to/src/Ext/util/Observable.js</code></p>
<p><code>Btti.pedidos.Listagem</code> é armazenado em <code>path/to/src/Btti/pedidos/Listagem.js</code></p>
<p style="text-align:justify";>aonde path/to/src é o diretório de classes da sua aplicação. Todas as classes devem estar em um único diretório e devem ser apropriadamente divididas em namespace, para melhor desenvolvimento, manutenção, e facilidades em implantações.</p>
<h3>Métodos e Variáveis</h3>
<p>Funcionam de forma análoga a classes, porém no padrão camelCase.</p>
<p><code>encodeUsingMd5()</code></p>
<p><code>getHtml()</code> ao invés de <code>getHTML()</code></p>
<p><code>var isGoodName</code></p>
<p><code>var base64Encoder</code></p>
<p><code>var xmlReader</code></p>
<h3>Propriedades</h3>
<p style="text-align:justify";>Seguem o mesmo padrão de métodos e variávels, exceto quando é uma propriedade estática de uma classe, que são constantes. Estas são escritas todas em maiúsculo:</p>
<p><code>Ext.MessageBox.YES = "Yes"</code></p>
<p><code>Btti.Viewport.THEME = 'btti-verde'</code></p>
<h2>Estrutura das Classes</h2>
<p>A maneira antiga de declarar classes gerava códigos similares a este:</p>
<p>[javascript]Ext.ns(&#8216;Btti.grid&#8217;);</p>
<p>Btti.grid.ListagemBase = Ext.extend(Ext.grid.GridPanel,{</p>
<p>	/** @readonly **/<br />
	totalRegistros: 20,</p>
<p>	 /** @cfg {Boolean} usaPaginacao Indica se o grid usa ou não paginação */<br />
    usaPaginacao: true,	</p>
<p>	initComponent: function()<br />
	{<br />
		if(this.usaPaginacao)<br />
		{<br />
			this.bbar = new Ext.PagingToolbar({<br />
				store: this.store,<br />
				pageSize: this.totalRegistros<br />
			});<br />
		}</p>
<p>		Btti.grid.ListagemBase.superclass.initComponent.call(this);<br />
	}<br />
});<br />
Ext.reg(&#8216;btti.listagembase&#8217;, Btti.grid.ListagemBase);[/javascript]</p>
<p style="text-align:justify";>Este código define uma classe <code>Btti.grid.ListagemBase</code> que serve como facilitador na criação de grids com paginação. Basta definir <code>usaPaginacao</code> true ou false, para criar o toolbar. Em complemento existe uma propriedade <code>totalRegistros</code> que é um valor padrão somente-leitura que nenhum desenvolvedor deveria sobreescrever. Apesar de funcionar bem, existem alguns inconvenientes com este modelo</p>
<p style="text-align:justify";>Primeiro, <code>Btti.grid</code> deve existir antes de associarmos <code>ListagemBase</code> a ele. Isso requer que usemos <code>Ext.namespace()</code> (ou o atalho <code>Ext.ns()</code>) para criar o namespace. Ainda, <code>Ext.grid.GridPanel</code> deve existir/estar carregado antes mesmo de iniciar este código. Mas <code>Ext.grid.GridPanel</code> pode ter dependências, e estas dependências possuírem outras dependências, o que nos força a carregar todo o framework em <code>ext-all.js</code> ao invés de somente os códigos que necessitamos.  E ainda, não existe uma separação clara entre propriedades da classe que não devem ser manipuladas (como <code>totalRegistros</code>), e configurações do usuário (como <code>usaPaginacao</code>).</p>
<p style="text-align:justify";>No Ext 4 tudo isso é resolvido, e resume-se nisto:</p>
<p>[javascript]Ext.define(&#8216;Btti.grid.ListagemBase&#8217;,{</p>
<p>	extend: &#8216;Ext.grid.Panel&#8217;,<br />
	alias: ['btti.listagembase'],</p>
<p>	/** @readonly **/<br />
	totalRegistros: 20,</p>
<p>	config:{</p>
<p>		/** @cfg {Boolean} usaPaginacao Indica se o grid usa ou não paginação */<br />
    	usaPaginacao: true</p>
<p>	},</p>
<p>	initComponent: function()<br />
	{<br />
		if(this.config.usaPaginacao)<br />
		{<br />
			this.dockedItems = this.dockedItems||[];<br />
			this.dockedItems.push({<br />
		        xtype: &#8216;pagingtoolbar&#8217;,<br />
		        dock: &#8216;bottom&#8217;,<br />
		        itemId: &#8216;paginacao&#8217;,<br />
		        store: this.store<br />
		   	});<br />
		}</p>
<p>		this.callParent();<br />
	},</p>
<p>	applyUsaPaginacao: function(usaPaginacao)<br />
	{<br />
		if(usaPaginacao === true)<br />
		{<br />
			this.addDocked({<br />
				xtype: &#8216;pagingtoolbar&#8217;,<br />
				dock: &#8216;bottom&#8217;,<br />
           		itemId: &#8216;paginacao&#8217;,<br />
           		store: this.store,<br />
				pageSize: this.totalRegistros<br />
			});<br />
		}<br />
		else<br />
		{<br />
			this.removeDocked(this.getDockedComponent(&#8216;paginacao&#8217;));<br />
		}<br />
	}</p>
<p>});[/javascript]</p>
<p style="text-align:justify";>O nome da classe, e também de quem ela extende, são strings. Isso evita erros caso o namespace ainda não tenha sido inicializado, ou a classe extendida não tenha sido carregada. O Ext trata de iniciar e carregar tudo, desde que a estrutura proposta nas convenções seja seguida.</p>
<p>Propriedades configuráveis pelo usuário (<i>config options</i>) agora estão reservadas em <code>config</code>. Além de ficar melhor estruturado, o Ext ainda cria automaticamente métodos <code>setUsaPaginacao</code> e <code>getUsaPaginacao</code>. E se algum código precisar ser executado ao alterar o valor da configuração, como no meu exemplo que é adicionar e remover o toolbar de paginação conforme a propriedade muda, pode ser implementado um método apply, como em <code>applyUsaPaginacao</code></p>
<p style="text-align:justify";>Outros detalhes que possam chamar a atenção:
<ul>
<li>
<p style="text-align:justify";>Redundâncias foram eliminadas, como <code>Ext.grid.GridPanel</code> para <code>Ext.grid.Panel</code>, <code>Ext.PagingToolbar</code> para <code>Ext.toolbar.Paging</code>, <code>Ext.tree.TreePanel</code> para <code>Ext.tree.Panel</code>, etc&#8230;</p>
</li>
<li>
<p style="text-align:justify";>Toolbars em componentes são considerados <code>dockedItems</code>. Eles podem ser ancorados em qualquer posição (topo, base, esquerda e direita), e podem existir vários, um adjacente ao outro.</p>
</li>
<li>
<p style="text-align:justify";>Invocar o método da classe pai agora é um simples <code>this.callParent();</code> ao invés de <code>Btti.grid.ListagemBase.superclass.initComponent.call(this);</code>.</p>
</li>
</ul>
<h2>Conclusão</h2>
<p style="text-align:justify";>Achei essas alterações as melhores da nova versão. Ficou bom demais escrever classes agora, pois tudo fica muito bem estruturado e fácil de manipular. Sem contar na conveniência de ter muito código automatizado pelo Ext.</p>
<p style="text-align:justify";>Também achei ótimo publicar as convenções de desenvolvimento. Tenho certeza que muitos desenvolvedores possuem opiniões diferentes, e talvez contrariem as convenções. Caso vá por este caminho, tenha em mente que muitas facilidades e automatizações possam não estar disponíveis para o seu código, e suas próprias convenções.</p>
<p style="text-align:justify";>Muitas das informações aqui publicadas foram extraídas do guia oficial  <a href="http://dev.sencha.com/deploy/ext-4.0.0/docs/guide/class_system.html">Class System</a>, publicado na documentação do Ext JS 4.0. Se vocês quiserem mais detalhes, este é o lugar para procurar.</p>
<p>Forte abraço, até a próxima.</p>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=296&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=296&amp;lang=pt" data-text="Novo sistema de classes Ext 4.0"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=296&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D296%26amp%3Blang%3Dpt&amp;linkname=Novo%20sistema%20de%20classes%20Ext%204.0" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D296%26amp%3Blang%3Dpt&amp;linkname=Novo%20sistema%20de%20classes%20Ext%204.0" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D296%26amp%3Blang%3Dpt&amp;linkname=Novo%20sistema%20de%20classes%20Ext%204.0" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D296%26amp%3Blang%3Dpt&amp;linkname=Novo%20sistema%20de%20classes%20Ext%204.0" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D296%26amp%3Blang%3Dpt&amp;linkname=Novo%20sistema%20de%20classes%20Ext%204.0" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D296%26amp%3Blang%3Dpt&amp;title=Novo%20sistema%20de%20classes%20Ext%204.0" id="wpa2a_28"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=296&#038;lang=pt</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Considerações sobre o lançamento do Ext 4.0</title>
		<link>http://extdesenv.com.br/?p=290&#038;lang=pt&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=consideracoes-sobre-o-lancamento-do-ext-4-0</link>
		<comments>http://extdesenv.com.br/?p=290&#038;lang=pt#comments</comments>
		<pubDate>Thu, 28 Apr 2011 22:21:20 +0000</pubDate>
		<dc:creator>brunotavares</dc:creator>
				<category><![CDATA[Notícias]]></category>
		<category><![CDATA[Ext JS 4.0]]></category>
		<category><![CDATA[Novidades]]></category>

		<guid isPermaLink="false">http://www.extdesenv.com.br/?p=290</guid>
		<description><![CDATA[O Ext 4.0 está aí! Saiba aqui algumas novidades e o que ter em mente antes de iniciar o desenvolvimento.  <a href="http://extdesenv.com.br/?p=290&#038;lang=pt">Continuar lendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">O tão aguardado Ext 4.0 está aí, e são muitas as novidades: gráficos, padrão MVC, novo pacote de Ext.data, nova estrutura de classes, etc etc etc&#8230; Dentre este oceano de alterações confesso que estou tão perdido quanto qualquer outro programador. Não vou ficar aqui ressaltando o que mudou, a equipe Ext fez um ótimo trabalho de publicação através dos <a href="http://www.vimeo.com/sencha">vídeos da Sencha Conf</a>, os <a href="http://www.sencha.com/blog">posts do blog</a>, e também os artigos que são distribuídos com a <a href="http://dev.sencha.com/deploy/ext-4.0.0/docs/">documentação oficial</a>. Vou aqui somente publicar minhas considerações.</p>
<h1>Reaprendendo o Ext</h1>
<p style="text-align: justify;">Quem programava Ext 1.0 sofreu com a nova versão 2.0. Era uma versão muito melhor, muito mais rápida, porém extremamente diferente. Traçar o mesmo paralelo entre a versão Ext 3.0 para a 4.0 pode ser um pouco exagerado, mas certos pontos realmente são válidos. A impressão é que você está reaprendendo o framework, porque não foram algumas melhorias pequenas como da versão 3.0 para 3.1, foram coisas essenciais, o código foi praticamente reescrito desde seu núcleo. É preciso voltar aos estudos, assistir apresentações, ler artigos, investir tempo na nova documentação, até adaptar-se a nova versão.</p>
<p style="text-align: justify;">Para começar  o sistema de classes mudou. A forma de escrever suas classes não é mais o mesmo. Só neste ponto eu creio que terei de alterar todos os fontes JS das minhas aplicações. Não que tudo vá parar de funcionar, porque a equipe irá lançar um arquivo de migração (Compat.js). Mas para ser 100% complacente com a nova versão, as definições de classes devem mudar.</p>
<p>[javascript]/*<br />
 *Como eram definidas as classes<br />
 */<br />
Ext.namespace(&#8216;App.cliente&#8217;);<br />
App.cliente.Cadastro = Ext.extend(Ext.form.FormPanel, {</p>
<p>	restUrl: &#8216;/clientes&#8217;,<br />
	clienteID: 0,</p>
<p>	initComponent: function()<br />
	{<br />
		//&#8230;<br />
		App.cliente.Cadastro.superclass.initComponent.call(this);<br />
	}<br />
});<br />
Ext.reg(&#8216;clientecadastro&#8217;,App.cliente.Cadastro);</p>
<p>/*<br />
 * A nova definição<br />
 */<br />
Ext.define(&#8216;App.cliente.Cadastro&#8217;, {</p>
<p>	restUrl: &#8216;/clientes&#8217;,</p>
<p>	config: {<br />
		clienteID: 0<br />
	},</p>
<p>	initComponent: function()<br />
	{<br />
		//&#8230;<br />
		this.callParent();<br />
	}<br />
});[/javascript]</p>
<h1>Arquitetura de Aplicação</h1>
<p style="text-align: justify;">Outra coisa, pela primeira vez na história da companhia uma arquitetura de aplicação foi publicada. Até então cada ninja Ext resolvia sua aplicação de uma forma. Algums orientados a objetos, outros nem tanto, alguns colocando todos scripts em um diretório, outros dividindo por namespace, etc&#8230;</p>
<div id="attachment_292" class="wp-caption aligncenter" style="width: 353px"><br />
<a href="http://www.extdesenv.com.br/wp-content/uploads/2011/04/folderStructure.png"><br />
<img class="size-full wp-image-292" title="ext-4-app-structure" src="http://www.extdesenv.com.br/wp-content/uploads/2011/04/folderStructure.png" alt="" width="343" height="517" /><br />
</a><p class="wp-caption-text">Estrutura dos arquivos</p></div>
<p style="text-align: justify;">Se adequar a nova estrutura é crucial para poder fazer uso do SDK que está sendo desenvolvido. Este SDK foi comentado na Sencha Conf, e assume que seus fontes e sua aplicação está toda organizada seguindo os padrões Sencha de desenvolvimento. Caso contrário, nada de automatização e algumas surpresinhas que eles estão reservando.</p>
<h1>Desempenho</h1>
<p style="text-align: justify;">Toda a reescrita do código foi pensada para ter mais robusteza e desempenho. De início posso dizer que com certeza ficou mais rápido. E as explicações são bem óbvias. Primeiro porque houve uma gigante diminuição de elementos DOM para cada componente. O Grid não usa mais um monte de &lt;div&gt; e sim uma &lt;table&gt;, os botões não usam mais uma complicada estrutura porque agora é usado CSS3 para fazer os degradês e cantos arredondas. Também por conta do CSS3 muitos sprites foram eliminados.</p>
<p style="text-align: justify;">Além disso o framework agora conta com carregamento dinâmico. Foi até uma agradável surpresa que minha função Ext.require tenha ido junto. Agora o Ext conta com essa função em seu núcleo, mas com o toque dos programadores Sencha que deram uma bela melhorada nela. O arquivo JS só é carregado quando a classe é requisitada. Mas claro, para isso sua aplicação deve seguir a arquitetura Sencha.</p>
<p style="text-align: justify;">Fiquei com um pouco de dúvida devido ao tamanho dessa versão: 1.1mb. E não é a versão debug, porque esta tem 2.4mb. Ainda estou a procura de melhores esclarecimentos. Não sei se é possível carregar o próprio Ext sob demanda, ou incluir o arquivo de 1mb será a única abordagem.</p>
<h1>Gráficos</h1>
<p style="text-align: justify;">Nesse ponto eu fiquei muito surpreso. O pessoal caprichou e criou uma biblioteca decente de gráficos sem usar flash, nem requerir nenhum plugin adicional. São dezenas de gráficos e opções para todos os gostos. Como tudo é Javascript, tudo pode ser alterado e personalizado sem problemas. Legendas, cores, animações, tooltips, tudo pode ser customizado, extendido ou melhorado. Os gráficos são rápidos e desempenham bem nos browsers modernos. Segundo a equipe até o IE6 suporta os gráficos&#8230;</p>
<p><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/04/ext-4-charts.jpg"><br />
<img class="aligncenter size-full wp-image-293" title="ext-4-charts" src="http://www.extdesenv.com.br/wp-content/uploads/2011/04/ext-4-charts.jpg" alt="" width="477" height="239" /><br />
</a></p>
<h1>Ext.data</h1>
<p style="text-align: justify;">Outro ponto que estou muito ansioso para explorar. O DataStore deixa de ser o chefão e passa a ser somente um complemento. Agora é possível fazer uma modelagem muito mais profissional usando a classe Ext.Model.</p>
<p><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/04/ext-data-package.jpg"><br />
<img class="aligncenter size-full wp-image-294" title="ext-data-package" src="http://www.extdesenv.com.br/wp-content/uploads/2011/04/ext-data-package.jpg" alt="" width="400" height="329" /><br />
</a></p>
<p>[javascript]//definir um model<br />
Ext.define(&#8216;User&#8217;, {<br />
    extend: &#8216;Ext.data.Model&#8217;,<br />
    fields: ['id', 'name', 'age'],<br />
    proxy: {<br />
        type: &#8216;rest&#8217;,<br />
        url : &#8216;/users&#8217;,<br />
        reader: {<br />
            type: &#8216;json&#8217;,<br />
            root: &#8216;users&#8217;<br />
        }<br />
    }<br />
});</p>
<p>//pegar referência do model<br />
var User = Ext.getModel(&#8216;User&#8217;);</p>
<p>//criar um usuário<br />
var ed = Ext.create(&#8216;User&#8217;, {<br />
    name: &#8216;Ed Spencer&#8217;,<br />
    age : 25<br />
});</p>
<p>//salvar diretamente sem intervenção de stores<br />
ed.save({<br />
    success: function(ed) {<br />
        console.log(&quot;Saved Ed! His ID is &quot;+ ed.getId());<br />
    }<br />
});</p>
<p>//ou carregar<br />
User.load(123, {<br />
    success: function(user) {<br />
        console.log(&quot;Loaded user 123: &quot; + user.get(&#8216;name&#8217;));<br />
    }<br />
});[/javascript]</p>
<h1>Temas</h1>
<p style="text-align: justify;">O pacote de temas foi alterado radicalmente, e posso dizer que ficou anos-luz a frente da versão anterior. Isso porque todas as imagens sprite para criar cantos arredondados e degradês foram removidas! Tudo agora é feito por CSS, e para o IE6 parece que existe uma solução que cria as imagens sprites sob demanda (confesso não me interessar muito, não dou suporte pra IE6).</p>
<p style="text-align: justify;">Para começar, está sendo utilizado SASS e Compass. SASS é uma ferramenta para deixar o CSS mais legal, permitindo variáveis, funções, enfim, uma nova forma de escrever CSS. Compass é uma biblioteca com funções padrões SASS, para criar degradês, cantos arredondados, e demais efeitos. Essas alterações realmente me agradaram, porque criar temas no Ext era MUITO chato. Para alterar a cor de um simples botão era preciso mudar o sprite inteiro do botão, nos estados normal, pressionado, com o mouse em cima, etc etc etc&#8230; chato, chato, chato. Agora é só usar um mixin (uma função CSS) para criar botões das mais diferentes cores.</p>
<p style="text-align: justify;"><a href="http://www.extdesenv.com.br/wp-content/uploads/2011/04/ext-button-sass.jpg"></p>
<p><img class="aligncenter size-full wp-image-295" title="ext-button-sass" src="http://www.extdesenv.com.br/wp-content/uploads/2011/04/ext-button-sass.jpg" alt="" width="500" height="268" /><br />
</a></p>
<h1>Conclusões</h1>
<p style="text-align: justify;">Como comentei, esse post foi somente para me colocar de volta à escrita e publicar minhas considerações sobre o Ext 4. Eu espero trazer em breve mais conteúdo educacional a medida que eu vou me aprofundando e descobrindo as mudanças do Ext 4.0.</p>
<p style="text-align: justify;">Por agora vou iniciar a mudança de um sistema iniciando pelos temas. Melhor lugar para começar é com a apresentação do Sencha Conf <a href="http://www.vimeo.com/19159630">Theming ExtJS 4.0</a>. Vou tentar me localizar com essa nova estrutura de diretórios e publico pra vocês as novidades.</p>
<p>Um forte abraço!</p>
<p><a class="a2a_button_facebook_like addtoany_special_service" data-href="http://extdesenv.com.br/?p=290&amp;lang=pt"></a><a class="a2a_button_twitter_tweet addtoany_special_service" data-count="none" data-url="http://extdesenv.com.br/?p=290&amp;lang=pt" data-text="Considerações sobre o lançamento do Ext 4.0"></a><a class="a2a_button_google_plus_share addtoany_special_service" data-annotation="none" data-href="http://extdesenv.com.br/?p=290&amp;lang=pt"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D290%26amp%3Blang%3Dpt&amp;linkname=Considera%C3%A7%C3%B5es%20sobre%20o%20lan%C3%A7amento%20do%20Ext%204.0" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D290%26amp%3Blang%3Dpt&amp;linkname=Considera%C3%A7%C3%B5es%20sobre%20o%20lan%C3%A7amento%20do%20Ext%204.0" title="Delicious" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_pinterest" href="http://www.addtoany.com/add_to/pinterest?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D290%26amp%3Blang%3Dpt&amp;linkname=Considera%C3%A7%C3%B5es%20sobre%20o%20lan%C3%A7amento%20do%20Ext%204.0" title="Pinterest" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/pinterest.png" width="16" height="16" alt="Pinterest"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D290%26amp%3Blang%3Dpt&amp;linkname=Considera%C3%A7%C3%B5es%20sobre%20o%20lan%C3%A7amento%20do%20Ext%204.0" title="Tumblr" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D290%26amp%3Blang%3Dpt&amp;linkname=Considera%C3%A7%C3%B5es%20sobre%20o%20lan%C3%A7amento%20do%20Ext%204.0" title="Email" rel="nofollow" target="_blank"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fextdesenv.com.br%2F%3Fp%3D290%26amp%3Blang%3Dpt&amp;title=Considera%C3%A7%C3%B5es%20sobre%20o%20lan%C3%A7amento%20do%20Ext%204.0" id="wpa2a_30"><img src="http://extdesenv.com.br/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://extdesenv.com.br/?feed=rss2&#038;p=290&#038;lang=pt</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>

