<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">

    <channel>
        <title>Sencha Blog</title>
        <link>http://www.sencha.com/blog/</link>
        <description>
            Technical articles, company news, and customer spotlights from Sencha.
        </description>
        <dc:language>en-us</dc:language>
        <dc:creator>tracy.pullman@sencha.com</dc:creator>
        <dc:rights>Copyright 2012</dc:rights>
        <dc:date>2012-12-17T05:59:05+00:00</dc:date>
        <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
        

        
        <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SenchaBlog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="senchablog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
        <title>Live Like a Rockstar at SenchaCon 2013!</title>
        <author>Tracy Pullman</author>
        <description>
            Have you ever wondered what it would be like to live like rock royalty? Well now is your chance! We are giving away the chance to win one of THREE Rockstar Packages to anyone who registers for SenchaCon 2013 by June 7, 2013.
        </description>
        <link>http://www.sencha.com/blog/live-like-a-rockstar-at-senchacon-2013/</link>
        <content:encoded>
            <![CDATA[
                <p><a href="http://www.senchacon.com/rockstar-promotion/?utm_source=website&amp;utm_medium=blog-rs&amp;utm_campaign=senchacon2013" target="_new"><img src="http://cdn.sencha.io/img/senchacon2013/senchacon-rockstar.jpg" width="636" alt="Live like a Rockstar at SenchaCon 2013" class="rounded"></a></p>

<p>Have you ever wondered what it would be like to live like rock royalty? Well now is your chance! We are giving away the chance to <a href="http://www.senchacon.com/rockstar-promotion/?utm_source=website&amp;utm_medium=blog-rs&amp;utm_campaign=senchacon2013" target="_new">win one of THREE Rockstar Packages</a> to anyone who registers for <a href="http://www.senchacon.com/?utm_source=website&amp;utm_medium=blog-rs&amp;utm_campaign=senchacon2013" target="_new">SenchaCon 2013</a> by June 7, 2013.</p>

<h3>Picture this...</h3>
<p>You are greeted at the airport by one of those people holding a sign with your name on it. On the 40 minute ride from the airport to the Swan &amp; Dolphin Resort, you sip a cold beverage and think about how awesome you are.</p>

<p>When you arrive at the Swan &amp; Dolphin, you are escorted to your PRESIDENTIAL suite complete with Wet Bar, Jacuzzi, and maybe even a Grand Piano. Say what?!</p>

<p><a href="http://cdn.sencha.io/img/20130514-rockstar/presidential-suite.jpg" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130514-rockstar/presidential-suite.jpg" width="500" class="aligncenter rounded" alt="SenchaCon Presidential Suite"></a></p>

<p>You enter the impressive foyer to find a Welcome Gift Basket and BlackBerry Z10 waiting for you. You take a leisurely stroll around your 2500+ square foot suite to check out the massive bedroom and expansive parlor only to be distracted by the sprawling views of the Swan &amp; Dolphin Resort overlooking Crescent Lake.</p>

<p><a href="http://cdn.sencha.io/img/20130514-rockstar/presidential-suite-floor-plan.gif" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130514-rockstar/presidential-suite-floor-plan.gif" width="200" class="alignright"></a>You decide to head out to the terrace to relax and truly appreciate how awesome it is to be you. After killing time being awesome, you decide to grab your BB10 and call up a few colleagues to brag to them (I mean, invite them) to join you in the parlor before you head down to the SenchaCon Welcome Reception.</p>

<p>You crack open some tasty snacks and a couple drinks from the gift basket to share with your friends and listen to them incessantly praise you on how lucky you are. Someone starts playing the piano and surprisingly they aren&rsquo;t bad.</p>

<p>It&rsquo;s now about 7:15pm, so you decide it&rsquo;s time to make a fashionably-late appearance at the Welcome Reception. As you and your posse head downstairs, you notice people staring at you wondering if they should ask to take a picture with you.</p>

<p>When you arrive at the registration desk, you are donned with the SenchaCon Rockstar Badge, and as you walk through the door to the party, heads turn, mouths drop and you think...</p>

<p><strong>It rocks to be me.</strong></p>

<p>Want this? <a href="https://www.senchacon.com/registration/fp?client_id=SENCHA&amp;event_id=SENCHACON%202013&amp;utm_source=website&amp;utm_medium=blog-rs&amp;utm_campaign=senchacon2013" target="_new">Register for SenchaCon 2013 now</a> and enter to win Rockstar treatment!</p>

<p>Only one person can win the Presidential Suite upgrade, but we&rsquo;re also giving away a pretty slick Governor&rsquo;s Suite upgrade, and a very nice Executive Suite upgrade as well! Get the full story <a href="http://www.senchacon.com/rockstar-promotion/?utm_source=website&amp;utm_medium=blog-rs&amp;utm_campaign=senchacon2013">here</a>.</p>

<br>

                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Wed, 15 May 2013 00:06 GMT</pubDate>
        <guid>http://www.sencha.com/blog/live-like-a-rockstar-at-senchacon-2013/#date:00:06</guid>
        </item>
        
        <item>
        <title>New Themes in Sencha Touch 2.2</title>
        <author>Rob Dougan, Seth Lemmons, and George Hoffer</author>
        <description>
            Sencha Touch 2.2 provides new capabilities for theming. Themes let you customize the CSS in your application for different platforms. A platform can be a different browser such as Chrome, Internet Explorer 10, or Safari, or a device category such as Android, iOS, BlackBerry 10, Windows Phone, or Microsoft Surface Pro or RT.
        </description>
        <link>http://www.sencha.com/blog/new-themes-in-sencha-touch-2-2/</link>
        <content:encoded>
            <![CDATA[
                <p><a href="http://www.sencha.com/products/touch/download/" target="_new">Sencha Touch 2.2</a> provides new capabilities for theming. Themes let you customize the CSS in your application for different platforms. A platform can be a different browser such as Chrome, Internet Explorer 10, or Safari, or a device category such as Android, iOS, BlackBerry 10, Windows Phone, or Microsoft Surface Pro or RT. With Sencha Touch, your application can detect which platform is in use and apply the appropriate theme for the platform. This way Sencha Touch gives you the power to customize your application&rsquo;s appearance for the browsers or devices on which it runs.</p>

<p>Windows Phone theme example:</p>

<img src="http://cdn.sencha.io/img/20130503-sencha-touch-themes/sencha-touch-themes-1.png" class="aligncenter">

<p>Sencha Touch provides a base theme that you can customize, or built-in themes for Sencha Touch, Internet Explorer 10, and BlackBerry 10 devices. You can create themes using <a href="http://sass-lang.com/" target="_new">Sass</a>, which installs for you with the new <a href="http://www.sencha.com/products/sencha-cmd/download" target="_new">Sencha Cmd 3.1</a>. Sencha Cmd works with <a href="http://www.ruby-lang.org/en/downloads/" target="_new">Ruby 1.9.3</a> to provide Compass and Sass for managing the packaged themes or creating custom themes for your applications.</p>

<p>You can use the base theme as a starting point. The base theme contains minimal styling information for just the framework. From there, you can build your own custom theme using your CSS.</p>

<p>In the following example taken from an application&rsquo;s app.json, the Apple theme loads if the platform is iOS.</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="st0">&quot;css&quot;</span><span class="sy0">:</span>  <span class="br0">&#91;</span>
 <span class="br0">&#123;</span>
  <span class="st0">&quot;path&quot;</span><span class="sy0">:</span> <span class="st0">&quot;resources/css/sencha-touch.css&quot;</span><span class="sy0">,</span>
  <span class="st0">&quot;platform&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">&quot;ios&quot;</span><span class="br0">&#93;</span><span class="sy0">,</span>
  <span class="st0">&quot;Theme&quot;</span><span class="sy0">:</span> <span class="st0">&quot;Apple&quot;</span>
 <span class="br0">&#125;</span> <span class="br0">&#93;</span>
&nbsp;</pre>

<p>You can test themes by using the theme parameter in the URL when running your app:<br/>
<a href="http://localhost/sdk/touch/examples/kitchensink/index.html?theme=Apple" target="_new">http://localhost/sdk/touch/examples/kitchensink/index.html?theme=Apple</a></p>

<h3>Platforms</h3>
<p>Platforms give you the ability to load specific resources in your app based on the platform your app is running on. In the following example, the sencha-touch.css file is available if the platform is Chrome, Safari, iOS, Android, or Firefox:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="st0">&quot;css&quot;</span><span class="sy0">:</span>   <span class="br0">&#91;</span> 	
<span class="br0">&#123;</span>
  <span class="st0">&quot;path&quot;</span><span class="sy0">:</span> <span class="st0">&quot;resources/css/sencha-touch.css&quot;</span><span class="sy0">,</span>
  <span class="st0">&quot;platform&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">&quot;chrome&quot;</span><span class="sy0">,</span> <span class="st0">&quot;safari&quot;</span><span class="sy0">,</span> <span class="st0">&quot;ios&quot;</span><span class="sy0">,</span> <span class="st0">&quot;android&quot;</span><span class="sy0">,</span> <span class="st0">&quot;firefox&quot;</span><span class="br0">&#93;</span>
<span class="br0">&#125;</span> <span class="br0">&#93;</span>
&nbsp;</pre>

<p>You can also specify multiple platforms, and use it to load JS resources. The following example loads the vendorfiles.js resource if the platform is Chrome, Safari, or iOS:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="st0">&quot;js&quot;</span><span class="sy0">:</span>   <span class="br0">&#91;</span>
 <span class="br0">&#123;</span>
  <span class="st0">&quot;path&quot;</span><span class="sy0">:</span> <span class="st0">&quot;vendorfiles.js&quot;</span><span class="sy0">,</span>
  <span class="st0">&quot;platform&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">&quot;chrome&quot;</span><span class="sy0">,</span> <span class="st0">&quot;safari&quot;</span><span class="sy0">,</span> <span class="st0">&quot;ios&quot;</span><span class="br0">&#93;</span>
<span class="br0">&#125;</span> <span class="br0">&#93;</span>
&nbsp;</pre>

<p>Each of these examples only loads the resource if the platform of the device running the application matches a platform that you specify for the resource. You can use the <code>?platform</code> parameter in a URL to test platform functionality.</p>

<p>The following example URL tests for Internet Explorer 10:
http://localhost/sdk/touch/examples/kitchensink/index.html?platform=ie10</p>

<p>You can also detect which platform the device is running on from within your application by using the <a href="http://docs.sencha.com/touch/2.2.0/#!/api/Ext.Class-cfg-platformConfig" target="_new">platformConfig</a> function.</p>

<p>The list of available platforms are:</p>
<ul>
<li>Phone</li>
<li>Tablet</li>
<li>Desktop</li>
<li>iOS</li>
<li>Android</li>
<li>BlackBerry</li>
<li>Safari</li>
<li>Chrome</li>
<li>IE10</li>
<li>Firefox</li>
</ul>

<h3>Icons</h3>

<p>One element of themes in Sencha Touch 2.2 is the new use of icons as fonts. Previously, scaling icons required a great deal of overhead where the application had to draw the picture for the icon and then redraw, rescale, and change it as the app appeared on different browsers and devices.</p>

<p>An icon can be like this button symbol:</p>

<img src="http://cdn.sencha.io/img/20130503-sencha-touch-themes/sencha-touch-themes-2.jpg" class="aligncenter rounded">

<p>New in Touch 2.2, icons are now handled as fonts, which enables very fast scaling without the need to redraw the picture. Icons appear on buttons and tabs.</p>

<p>To convert your existing icons to fonts, you can use Pictos Server, Pictonic, icomoon.io, or <a href="http://fontstruct.com/">http://fontstruct.com/</a> &mdash; some of these are free or available with trial subscriptions.</p>

<h3>Using the Pictos Font</h3>
<p>The Pictos font provides a large collection of free icons. You can find a full list of characters available for the Pictos font at <a href="http://www.pictos.cc">http://www.pictos.cc</a>. Sencha Touch provides free access to the Pictos <a href="http://pictos.cc/font/" target="_new">Font Pack</a>:</p>

<img src="http://cdn.sencha.io/img/20130503-sencha-touch-themes/sencha-touch-themes-3.jpg" class="aligncenter rounded">

<p>When you build your application using Sencha Cmd, the font libraries are copied to your application file.</p>

<p>Sencha Touch conveniently maps icon names to actual icons, so you can use them within your application.</p> 

<p>Here&rsquo;s an example:</p>
<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="br0">&#123;</span>  xtype<span class="sy0">:</span> <span class="st0">'button'</span><span class="sy0">,</span>  iconCls<span class="sy0">:</span> <span class="st0">'home'</span><span class="sy0">,</span>  title<span class="sy0">:</span> <span class="st0">'Home'</span>  <span class="br0">&#125;</span>
&nbsp;</pre>

<p>Alternatively, you can use the Compass icon mixin to map a specific character of the icon font to an iconCls which you can use in your app:</p>
<style><!-- GeSHi could not find the language {LANGUAGE} (using path {PATH}) --></style><pre class="scss">&nbsp;
@include icon('home', 'H');
&nbsp;</pre>

<h3>Using Other Icon Fonts</h3>

<p>The Pictos font is not the only font you can use in your application. If you know of another font or you have custom converted your icons to fonts, it is very easy to use that font with the icon mixin.</p>

<p>Just like with the Pictos font, you need to specify the iconCls and character to be used for the icon. Additionally, you need to specify the name of the icon font, which needs to match the font family of the icon font you have, plus you need to make sure the font has been included in your CSS using the icon-font mixin.</p>

<p>This example specifies the Home icon in the custom MyFont:</p>
<style><!-- GeSHi could not find the language {LANGUAGE} (using path {PATH}) --></style><pre class="scss">&nbsp;
@include icon('home', 'H', 'MyFont');
&nbsp;</pre>

<p>The following example shows how to include the Pictos font using the icon-font mixin: </p>

<style><!-- GeSHi could not find the language {LANGUAGE} (using path {PATH}) --></style><pre class="scss">&nbsp;
@include icon-font('Pictos', inline-font-files('pictos/pictos-web.woff', woff, 'pictos/pictos-web.ttf', truetype,'pictos/pictos-web.svg', svg));
&nbsp;</pre>

<p>The first parameter is the name of the font face, which must match the name you use as the CSS font-family. The second parameter uses the inline-font-files Compass function to base64-encode the font file inline into the CSS file with paths to the WOFF, TTF, and SVG versions of the font files.</p>

<p>Here&rsquo;s a good list of other icon fonts (some paid and some free): <a href="http://css-tricks.com/flat-icons-icon-fonts/" target="_new">http://css-tricks.com/flat-icons-icon-fonts/</a></p>

<h3>Conclusion</h3>
<p>With the new Sencha Touch themes, you have the power you need to target your applications to specific mobile devices and platforms. Themes and icons help make your applications visually appealing with better performance. With the Sencha Touch themes, you can portray your application consistently across a wide range of device types. Consistency helps reduce documentation and support needs, so you reduce costs and can focus on building new features.</p>

                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Tue, 14 May 2013 15:00 GMT</pubDate>
        <guid>http://www.sencha.com/blog/new-themes-in-sencha-touch-2-2/#date:15:00</guid>
        </item>
        
        <item>
        <title>Sencha Touch Customer Spotlight: Nervana Group</title>
        <author>Rhon Daguro</author>
        <description>
            Nervana Group is an interactive innovation firm that uses Sencha Touch to build mobile apps and large format touch screens for many different clients including Hard Rock Hotel, Swissotel and DePaul University. Read about how Sencha Touch has helped them reduce development time and work interactively with their clients.
        </description>
        <link>http://www.sencha.com/blog/sencha-touch-customer-spotlight-nervana-group/</link>
        <content:encoded>
            <![CDATA[
                <p><img src="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-hero.png" alt="Nervana Group" width="636" class="aligncenter"></p>

<p><img src="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-logo.jpg" alt="Nervana Group" width="120" class="alignright rounded shadow"><a href="http://www.nervanagroup.com" target="_new">Nervana Group</a> is an interactive innovation firm that focuses on developing solutions for clients who want to interact better with their customers. Nervana Group won the Chicago Innovation Awards based on our hospitality technology and was featured as one of the Top 100 Most Innovative Companies in Chicago.</p>

<p>We use Sencha Touch to build mobile apps and <a href="http://vimeo.com/33026515" target="_new">large format touch screens</a> for many different clients including Hard Rock Hotel, Swissotel and DePaul University. What&rsquo;s unique about the applications we build is our methodology and approach to make emotion a key element in scoring our software before delivering to the client. Our five pillars of measurement are Features, Functionality, Design, Usability and Emotion.</p>

<figure class="aligncenter">
<a href="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-1.jpg"><img src="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-1.jpg" alt="Nervana Group" width="636"></a>
<figcaption style="text-align:center;">Built an app on a large form factor using Sencha Touch. This application is running on a 55" touch screen.</figcaption>
</figure>

<h3>Why We Chose Sencha Touch</h3>
<p>We chose Sencha Touch because it reduces our development time and lets us work interactively with our clients. And, we&rsquo;ve used Sencha Architect as a starting point for all of our most recent projects. Rather than presenting static Photoshop layouts, we walk into a meeting with an actual working, interactive prototype. Sencha Touch is a fast, clean, high-performance framework that fits our thinking and helps us to win new clients. We&rsquo;ve used Sencha Touch since it came out in early beta, so we&rsquo;re very experienced with the framework and thrilled with how much faster we can build apps.</p>

<p>The Sencha Touch MVC pattern gives us the assurance that whatever we build, we can expand. It&rsquo;s a big advantage over other frameworks like JQuery Mobile. That&rsquo;s critical for our strategic direction in development because we always need to be ready for changes as our clients&rsquo; requirements evolve. Having the ability to separate out components, both MVC and the whole component library is key to reducing development time. We can have developers work on different parts of the project, and the framework provides development patterns that ensure we&rsquo;re using best practices to organize our code. We&rsquo;ve done a lot of customization to carousel components, and it&rsquo;s allowed us to separate that one feature, so it&rsquo;s really easy to change it later.</p>

<p>We&rsquo;re huge fans of HTML5. We&rsquo;ve been working on replacing full-blown native apps with HTML5 apps. We use all of the Sencha Touch components including templates, carousel, scroll lists, buttons, theming, and more. Sencha Touch gives us a rich component suite, and we use the components to create a native-like feel. We rely on Sencha Touch because it&rsquo;s a complete framework that is always on the leading edge. Something new comes out and Sencha is on top of it &mdash; iOS, Android, BlackBerry 10, Windows Phone 8. It makes it so much easier for developers to keep up with the latest devices.</p>

<figure class="aligncenter">
<a href="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-2.png"><img src="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-2.png" alt="Nervana Group" width="636"></a>
<figcaption style="text-align:center;">Using Sencha Touch to create a restaurant menu application, we can easily adapt to different devices from phone to tablets and show off lots of information with panels, lists, theming and more.</figcaption>
</figure>

<p>Multi-platform support is a key part of our products. Using Sencha Touch, we know that our apps will work seamlessly across all platforms. The rich components are incredible right out of the box, but the best part is how easy it is to change their functionality and styling. The flexible layout model scales to lots of different devices as well as orientations. Our confidence in Sencha allows us to focus on building great features for the app rather than testing cross-platform compatibility. Products are increasingly catering to the bring your own device trend, and it is important to be as widely compatible as possible. One of our event apps allows attendees to access event data on their own devices. In this scenario, we had to build our app to work on phone and tablet form factors as well as any orientation. It would have been insanely labor intensive to account for all of those things without Sencha.</p>

<figure class="aligncenter">
<a href="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-3.png"><img src="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-3.png" alt="Nervana Group" width="400"></a>
<a href="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-4.png"><img src="http://cdn.sencha.io/img/20130504-nervana-group/nervana-group-4.png" alt="Nervana Group" width="100"></a>
<figcaption style="text-align:center;">Sencha Touch enabled us to build this event app for phone and tablet form factors as well as any orientation.</figcaption>
</figure>

<p>One of our favorite features is the built-in templates. Complex data can be presented in a very clean manner using the built-in conditional and looping features. Having the whole component driven by a store instead of dealing with complex object layouts also helps to simplify everything. When looking back on our old techniques of building dynamic applications with a hodge podge of AJAX calls, string concatenation and dom manipulation, they seem like tools of the stone age.</p>

<p>The event model in Sencha Touch is so complete that it&rsquo;s enabled us to drive our business based on interaction with our users. We&rsquo;ve built analytics on top of our products, so we can make changes based on real-world feedback. Capturing this data was very simple. The vast number of events available provided the perfect method to capture every user interaction. After capturing the events, we do some basic filtering before we send them off to our own analytics engine along with Google analytics.</p>

<h3>Business Value of Using Sencha Touch</h3>
<p>Before we chose Sencha Touch, we were using a mixture of JQuery Mobile, Adobe Flash and Microsoft Silverlight, and our project timeframes were 4&ndash;6 weeks on small projects; bigger initiatives were 8-10 weeks. Now, with Sencha Touch, we are doing full-blown app delivery in 4&ndash;6 weeks on big projects. From a cost perspective, we&rsquo;ve gotten 33% upside on deals because delivery time is that much faster.</p>

<p>One of the unique things about using Sencha Touch is that we can hire new developers and train them in-house. With a background in HTML5, Java or .NET, they can be trained and productive in four weeks. The Sencha Touch framework makes it possible for them to contribute much faster, and we can build qualified staff more quickly, so we&rsquo;re not resource strapped. Previously, we had to hire developers with a particular skill set and then spend as long as four months on training to get them up to speed.</p>

<h3>Our Advice to New Developers</h3>
<p>Sencha Touch is the fastest way to develop prototype applications, so you can determine the viability of your project. Once you&rsquo;ve settled on the approach for your app, it takes just a few more modifications to make it ready for prime time. The speed from idea to market is lightning fast with Sencha Touch and Sencha Architect, so use them to prototype and iterate quickly.</p>

<p>You should be active in the forums because there are so many resources. It&rsquo;s amazing how many people share their expertise and help new developers. You should also be active in your local Sencha user group (we&rsquo;re active members of the user group in Chicago). Get to know people and take advantage of the many resources out there.</p>

<p>The docs are amazing, especially the latest version that includes live examples that you can play with. They&rsquo;re very complete and a powerful tool for new developers who can review the examples and then make changes to learn the framework.</p>

<h3>Final Thoughts</h3>
<p>Our choice of Sencha Touch has really paid off. It has been the defining factor of why we&rsquo;ve been so successful. We won the Chicago Innovation Award with Sencha framework. The product is proven and works, and it&rsquo;s always on the leading edge. If you&rsquo;re a company building apps in this new generation: mobile or touch world, you should use Sencha Touch. You can build prototypes rapidly &mdash; you share a URL, win business, and move on. So much simpler and faster.</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Fri, 10 May 2013 15:00 GMT</pubDate>
        <guid>http://www.sencha.com/blog/sencha-touch-customer-spotlight-nervana-group/#date:15:00</guid>
        </item>
        
        <item>
        <title>Developing Mobile Applications with Force.com and Sencha Touch - Part 3</title>
        <author>Don Robins</author>
        <description>
            In Part 1 and Part 2 of our series on Developing Mobile Applications with Force.com and Sencha Touch, we built out a simple mobile application hosted in a Salesforce.com Visualforce page to display a list of Leads, and allowing add, edit and delete capability using an Apex controller. In this third part of the series, we want to highlight the enterprise data capability of Sencha Touch, so we’ll focus on how the framework allows us to work with large datasets by adding paging and search capability to the PocketCRM application.
        </description>
        <link>http://www.sencha.com/blog/developing-mobile-applications-with-force.com-and-sencha-touch-part-3/</link>
        <content:encoded>
            <![CDATA[
                <h3>Overview</h3>
<p><img src="http://cdn.sencha.io/img/20130521-force-sencha-touch-p3.png" alt="Sencha + SFDC" width="175" class="alignright rounded shadow">In <a href="http://www.sencha.com/blog/developing-mobile-applications-with-force-com-and-sencha-touch-part-1/">Part 1</a> and <a href="http://www.sencha.com/blog/developing-mobile-applications-with-force-com-and-sencha-touch-part-2/">Part 2</a> of our series on Developing Mobile Applications with Force.com and Sencha Touch, we built out a simple mobile application hosted in a Salesforce.com Visualforce page to display a list of Leads, and allowing add, edit and delete capability using an Apex controller. </p>

<p>In this third part of the series, we want to highlight the enterprise data capability of Sencha Touch, so we&rsquo;ll focus on how the framework allows us to work with large datasets by adding paging and search capability to the PocketCRM application.</p> 

<p>Along the way, we&rsquo;ll show you how well the Sencha data proxy works in conjunction with querying data in Apex using SOQL and its OFFSET paging feature, and we&rsquo;ll leverage the concept of Sencha plugins for component reusability and extensibility.</p>

<p>Here&rsquo;s what we&rsquo;ll accomplish in part three of the tutorial:</p>

<ol>
  <li>Add &lsquo;scroll down&rsquo; paging to automatically fetch the next &lsquo;n&rsquo; records when a user scrolls to the bottom of a list.</li>
  <li>Redesign the query capability of our Apex controller class to provide efficient data paging using SOQL OFFSET and a search filter.</li>
  <li>Add a Search Field in the list view, allowing a user to filter records fetched from Salesforce by a search on any portion of a Lead&rsquo;s first or last name.</li>
  <li>Display a count of how many records are currently contained in the list, and include listeners to properly refresh the count whenever the list changes.</li>
</ol>
  
<p>So let&rsquo;s get started.</p>

<h3>Let's Dig Back In</h3>
<p>What differentiates Sencha Touch from other JavaScript libraries and frameworks is how well it supports large and complex mobile applications. This makes it a great fit for mobile in the enterprise, where there are typically more stringent requirements regarding identity, security, business rules, and of course large volumes of data. As such, it&rsquo;s perfect for building mobile apps to extend Salesforce.com CRM functionality, or Force.com custom enterprise applications. In addition, as we&rsquo;ve already seen, it is easily hosted in Visualforce. We&rsquo;ll pick up where we left off, to introduce the concept of list paging and search in Sencha Touch </p> 

<p>It&rsquo;s a given that any effective enterprise mobile application must provide the capability to manage large sets of records for any data entity that a user has access to. Our Salesforce.com implementation could store thousands or even tens of thousands of Leads, and there&rsquo;s no telling just how many records our application will need to serve up for any particular user, as different users have different sharing rights on the data. Therefore, we must provide a user experience that makes it easy and fast for any user to find and browse a reasonable number of Leads for which they have access.</p>

<p>Sencha Touch includes a variety of tools to provide just what we need. We&rsquo;re going to add a plugin component that automatically provides a &ldquo;Load More...&rdquo; paging feature to our Lead list. This component allows us to set a default page size for the initial record load, and as the user scrolls to the bottom of the populated list, the application automatically fetches the next &lsquo;page&rsquo; of records based on that default. It also manages adding the newly fetched records to those already in the list, and when all of the records available have been fetched, a &ldquo;No More Records&rdquo; message is displayed.</p> 

<p>It&rsquo;s always a best practice to use a maximum fetch limit to ensure that device memory is not exceeded, and because there is likely a ceiling beyond which it makes little sense to continue fetching records into a mobile device. The maximum SOQL offset allowed is 2000, more than enough for our purposes, (and if you really need to be able to fetch more records with SOQL, you can utilize alternate Apex query patterns in your controller.)</p> 

<p>However, it isn&rsquo;t likely that users of mobile devices will be required to manage lists of more than a few hundred records. Even though the Sencha list component can effectively manage lists of up to 1000 items, (depending on device memory and record configuration,) we&rsquo;ll put a limit of 500 records on the query method in the Apex controller. We&rsquo;ll also set our <code>pageSize</code> configuration to 25 in the Sencha data store component. The page size value is passed to the Apex controller with the query request, and is used to control paging by the SOQL OFFSET feature.</p>

<p>Fire up your development environment for the PocketCRM app that you last completed in Part 2, (if you're just tuning in now to the series, you'll need to go back to <a href="http://www.sencha.com/blog/developing-mobile-applications-with-force-com-and-sencha-touch-part-1/">Part 1</a> and <a href="http://www.sencha.com/blog/developing-mobile-applications-with-force-com-and-sencha-touch-part-2/">Part 2</a> to build out the application.) We'll remind you to use Safari with its development tools as a desktop emulator and development environment for your tracing and debugging.</p> 

<p>Login to your Salesforce org, and launch the PocketCRM Visualforce page so that the mobile application is up and running in a Safari browser, so that you&rsquo;ll be able to test the changes we&rsquo;re about to make to the code.</p>

<h3>Step 1: Add The ListPage Plugin To The ListView</h3>

<p>Plugins are JavaScript classes that can add additional behavior or appearance to existing components upon their instantiation. You can write your own custom plugins, use those provided by Sencha in the framework, or tap into those built by developers in the Sencha community, many of which are posted and freely available in public repositories such as Git. We're going to use one of the Sencha provided plugins for our paging mechanism, as it does exactly what we want for our &ldquo;Load More...&rdquo; feature.</p>

<p>Open the PocketCRM_APP Visualforce component in your development environment and add the code for the <code>plugins</code> configuration below to the PocketCRM.views.LeadsList component, just after the <code>disableSelection</code> and before the template configurations. It doesn&rsquo;t have to be placed in any particular sequence in the configuration section, just make sure you have comma delimiters for each configuration that precedes or follows it:</p> 

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="co1">//The main list and its properties. </span>
xtype<span class="sy0">:</span> <span class="st0">&quot;list&quot;</span><span class="sy0">,</span>
store<span class="sy0">:</span> <span class="st0">&quot;Leads&quot;</span><span class="sy0">,</span>
itemId<span class="sy0">:</span><span class="st0">&quot;leadsList&quot;</span><span class="sy0">,</span>
...
<span class="me1">disableSelection</span><span class="sy0">:</span> <span class="kw2">false</span><span class="sy0">,</span>
&nbsp;
plugins<span class="sy0">:</span> <span class="br0">&#91;</span>
    <span class="br0">&#123;</span>
        xclass<span class="sy0">:</span> <span class="st0">'Ext.plugin.ListPaging'</span><span class="sy0">,</span>
        autoPaging<span class="sy0">:</span> <span class="kw2">false</span>  <span class="co1">//set true for automatic fetching when user reaches bottom of the list</span>
    <span class="br0">&#125;</span>
<span class="br0">&#93;</span><span class="sy0">,</span>
&nbsp;
<span class="co1">//The template for display if the Store is empty of records.</span>
<span class="co1">//Note the style to control visual presentation.</span>
loadingText<span class="sy0">:</span> <span class="st0">&quot;Loading Leads...&quot;</span><span class="sy0">,</span>
...
&nbsp;</pre>

<p>Next, modify the PocketCRM.store.Leads component to reduce the <code>pageSize</code> configuration (on line 9 below) from 50 to 25, so that each successive fetch will add 25 records to the list. You can set this value to any page size you&rsquo;d like while testing the behavior. The store component should look like this:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
Ext.<span class="me1">define</span><span class="br0">&#40;</span><span class="st0">&quot;PocketCRM.store.Leads&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span>
    extend<span class="sy0">:</span> <span class="st0">&quot;Ext.data.Store&quot;</span><span class="sy0">,</span>
    requires<span class="sy0">:</span> <span class="st0">&quot;Ext.data.proxy.LocalStorage&quot;</span><span class="sy0">,</span>
&nbsp;
    config<span class="sy0">:</span> <span class="br0">&#123;</span>
        model<span class="sy0">:</span> <span class="st0">&quot;PocketCRM.model.Lead&quot;</span><span class="sy0">,</span>
        autoLoad<span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span>
        <span class="co1">//Set your desired PAGE SIZE.  </span>
        pageSize<span class="sy0">:</span> <span class="nu0">25</span><span class="sy0">,</span>
        groupField<span class="sy0">:</span> <span class="st0">&quot;Status&quot;</span><span class="sy0">,</span>
        groupDir<span class="sy0">:</span> <span class="st0">&quot;ASC&quot;</span><span class="sy0">,</span>
        sorters<span class="sy0">:</span> <span class="br0">&#91;</span>
            <span class="br0">&#123;</span> property<span class="sy0">:</span> <span class="st0">'LastName'</span><span class="sy0">,</span> direction<span class="sy0">:</span> <span class="st0">'ASC'</span><span class="br0">&#125;</span><span class="sy0">,</span>
            <span class="br0">&#123;</span> property<span class="sy0">:</span> <span class="st0">'FirstName'</span><span class="sy0">,</span> direction<span class="sy0">:</span> <span class="st0">'ASC'</span><span class="br0">&#125;</span>
        <span class="br0">&#93;</span>     
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;</pre>

<p>After you have modified your code, refresh your application in the browser. If no errors were introduced, it should display as many Lead records as you set for the pageSize, with a link at the bottom to &ldquo;Load More...&rdquo; records. Click the link, and you should see another &ldquo;page&rdquo; of records appended to the list, and the link displayed again. You can continue to load the list until you hit the LIMIT as set on the SOQL query in the Apex controller&rsquo;s <code>getAllLeads()</code> helper method, which we had arbitrarily set to 50. Experiment with it to see what happens when the limit is reached, and try bumping up the LIMIT as well to get a feel for the the behavior as you load a larger set of records.</p>

<p><img src="http://cdn.sencha.io/img/20130408-force-p3/SenchaForcePart3_Image01.png" class="rounded shadow aligncenter" alt="Sencha + SFDC"></p>

<p>Also notice the plugin&rsquo;s configuration setting on line 7 above:</p> 

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
autoPaging<span class="sy0">:</span> <span class="kw2">false</span>
&nbsp;</pre>

<p>Setting this configuration&rsquo;s value to <code>true</code> will cause the paging to fire automatically each time the user scrolls to the bottom of the list. You can choose whether you want the paging to fire automatically or not for your application, but experiment with both settings now to experience the behavior.</p>

<h3>Step 2: Refactor the Apex Controller Query Methods</h3>

<p>Now that the paging plugin is in place and functioning, we need to optimize how it will work in conjunction with our SOQL in the Apex controller. Previously, we had included some rudimentary paging logic in the @RemoteAction query method which is why you&rsquo;re seeing more records served up when each new page is requested.</p> 

<p>You can see how we wrote the initial paging logic in the original Apex method. After all Lead records are fetched, a <code>for</code> loop partitions out just the page of records as defined by the <code>start</code> and <code>recordCount</code> properties passed in the request object from the Sencha data proxy.</p> 

<p>The existing code looks like this:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="sy0">@</span>RemoteAction
<span class="kw2">public</span> static Response Query<span class="br0">&#40;</span>QueryRequest qr<span class="br0">&#41;</span><span class="br0">&#123;</span>
    Response resp <span class="sy0">=</span> <span class="kw2">new</span> Response<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    List<span class="sy0">&lt;</span>Lead<span class="sy0">&gt;</span> LeadList<span class="sy0">;</span>
    filterString <span class="sy0">=</span> qr.<span class="me1">searchFilter</span><span class="sy0">;</span>
&nbsp;
    <span class="kw1">try</span> <span class="br0">&#123;</span>
        <span class="co1">//Fetch all Leads for the user</span>
        LeadList <span class="sy0">=</span> getAllLeads<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span>Exception e<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        resp.<span class="me1">success</span> <span class="sy0">=</span> <span class="kw2">false</span><span class="sy0">;</span>
        resp.<span class="me1">errorMessage</span> <span class="sy0">=</span> <span class="st0">'Query failed: '</span> <span class="sy0">+</span> e.<span class="me1">getMessage</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="kw1">return</span> resp<span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="co1">//Supply only the requested records</span>
    <span class="kw1">for</span> <span class="br0">&#40;</span>Integer recno <span class="sy0">=</span> qr.<span class="me1">start</span><span class="sy0">;</span> recno <span class="sy0">&lt;</span> <span class="br0">&#40;</span>qr.<span class="me1">start</span> <span class="sy0">+</span> qr.<span class="me1">recordCount</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> recno <span class="sy0">&lt;</span> LeadList.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="sy0">++</span>recno<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        resp.<span class="me1">records</span>.<span class="me1">add</span><span class="br0">&#40;</span>LeadList<span class="br0">&#91;</span>recno<span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
    resp.<span class="me1">total</span> <span class="sy0">=</span> LeadList.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>   
    resp.<span class="me1">success</span> <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span>
    <span class="kw1">return</span> resp<span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>The flaw in this pattern is that all Lead records available to the current user are fetched and iterated over with each request, even though only a small number are actually required to be returned; a most inefficient process. Salesforce has a few different patterns available for fetching sets of objects, and we will take advantage of the SOQL OFFSET feature which works well with the page size and record count properties that we have already built, and are available from our request object.</p>

<p>We need to change two methods in our Apex controller to implement the new version of the paging logic. First, we&rsquo;re going to change the helper method that will return the page of records. The original method looks like this:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="kw2">private</span> static List <span class="sy0">&lt;</span> Lead <span class="sy0">&gt;</span> getAllLeads<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw1">return</span> <span class="br0">&#91;</span>SELECT FirstName<span class="sy0">,</span> LastName<span class="sy0">,</span> Company<span class="sy0">,</span> Title<span class="sy0">,</span> Phone<span class="sy0">,</span> MobilePhone<span class="sy0">,</span> Email<span class="sy0">,</span> <span class="kw3">Status</span>        FROM Lead LIMIT <span class="nu0">50</span><span class="br0">&#93;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>Replace that method with the new version below; it&rsquo;s a bit more code, but actually very straightforward. It simply calculates the paging values using the parameters passed in the request, builds one query to get a count of all records, and another query to fetch the exact page of records based on the calculated paging values. Note the OFFSET and LIMIT portions of the SOQL query.</p>

<p>Also note the SOQL whereClause variable which constructs a filter using the <code>qr.searchFilter</code> property. We&rsquo;ll use this property shortly to pass a search string from the Sencha application to filter the query, and we&rsquo;ll initially default its value to a SOQL wildcard so that all records will be fetched for the SELECT. Our code also checks to determine if an empty string is passed, in which case the WHERE clause will simply be omitted from the query.</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="kw2">private</span> static <span class="kw1">void</span> getAllLeads<span class="br0">&#40;</span>QueryRequest qr<span class="sy0">,</span> Response resp<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
    <span class="co1">//Page size is set in the Sencha store as recordCount.    </span>
    Integer pageSize <span class="sy0">=</span> qr.<span class="me1">recordCount</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">//Page number will be calculated.</span>
    Integer pageNumber <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">//Start is the record number indicating the start of the page.</span>
    <span class="kw1">if</span> <span class="br0">&#40;</span>qr.<span class="me1">start</span> <span class="sy0">&gt;</span> <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    	pageNumber <span class="sy0">=</span> qr.<span class="me1">start</span> <span class="sy0">/</span> pageSize<span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="co1">//Calculate the offset for SOQL.</span>
    Integer offset <span class="sy0">=</span> pageNumber <span class="sy0">*</span> pageSize<span class="sy0">;</span>
&nbsp;
    <span class="co1">//Build the query in pieces.</span>
    String fieldList <span class="sy0">=</span> <span class="st0">'Id,FirstName,LastName,Company,Title,Phone,MobilePhone,Email,Status'</span><span class="sy0">;</span>
    String whereClause <span class="sy0">=</span> <span class="br0">&#40;</span>qr.<span class="me1">searchFilter</span> <span class="sy0">!=</span> <span class="st0">''</span> <span class="sy0">?</span> <span class="st0">'WHERE Name LIKE <span class="es0">\'</span>'</span> <span class="sy0">+</span> qr.<span class="me1">searchFilter</span> <span class="sy0">+</span> <span class="st0">'<span class="es0">\'</span>'</span> <span class="sy0">:</span> <span class="st0">''</span><span class="br0">&#41;</span><span class="sy0">;</span>
    String orderByClause <span class="sy0">=</span> <span class="st0">'LastName, FirstName'</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">//Construct a base query to which the page offsets will be added.</span>
    String baseQuery <span class="sy0">=</span> <span class="st0">'SELECT '</span> <span class="sy0">+</span> fieldList <span class="sy0">+</span> <span class="st0">' FROM Lead '</span> <span class="sy0">+</span> whereClause <span class="sy0">+</span> <span class="st0">' ORDER BY '</span> <span class="sy0">+</span> orderByClause<span class="sy0">;</span>
&nbsp;
    <span class="co1">//Construct a count query to pass back the total records matching a search criteria.</span>
    String baseCountQuery <span class="sy0">=</span> <span class="st0">'SELECT COUNT() FROM Lead '</span> <span class="sy0">+</span> whereClause<span class="sy0">;</span>
&nbsp;
    <span class="co1">//Construct the fetch query with the offset.</span>
    String fetchQuery <span class="sy0">=</span> baseQuery <span class="sy0">+</span> <span class="st0">' LIMIT '</span> <span class="sy0">+</span> pageSize <span class="sy0">+</span> <span class="st0">' OFFSET '</span> <span class="sy0">+</span> offset<span class="sy0">;</span>
&nbsp;
    <span class="kw1">try</span> <span class="br0">&#123;</span>
&nbsp;
    	<span class="co1">//Set the count.</span>
    	resp.<span class="me1">total</span> <span class="sy0">=</span> Database.<span class="me1">countQuery</span><span class="br0">&#40;</span>baseCountQuery<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    	<span class="co1">//Set the fetched recordset.</span>
    	resp.<span class="me1">records</span> <span class="sy0">=</span> Database.<span class="me1">query</span><span class="br0">&#40;</span>fetchQuery<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    	<span class="co1">//Set the status flag.</span>
    	resp.<span class="me1">success</span> <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span>
&nbsp;
    <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span>Exception e<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
    	<span class="co1">//Set the total count of records matching the query.</span>
    	resp.<span class="me1">total</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span>
&nbsp;
    	<span class="co1">//Set the recordset to return.</span>
    	resp.<span class="me1">records</span> <span class="sy0">=</span> <span class="kw2">new</span> List <span class="sy0">&lt;</span> Lead <span class="sy0">&gt;</span> <span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    	<span class="co1">//Set the status flag.</span>
    	resp.<span class="me1">success</span> <span class="sy0">=</span> <span class="kw2">false</span><span class="sy0">;</span>
&nbsp;
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>The SOQL OFFSET processing is very efficient, fetching only the exact set of records requested. Notice the method takes both the QueryRequest and Response objects as parameters, and sets the properties of the Response object to be sent back to the Sencha application. Before you can save the controller class, you must also modify the @RemoteAction <code>Query()</code> method to work with the new version of the helper method above, replacing the old method with the following code:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="sy0">@</span>RemoteAction
<span class="kw2">public</span> static Response Query<span class="br0">&#40;</span>QueryRequest qr<span class="br0">&#41;</span><span class="br0">&#123;</span>
&nbsp;
    Response resp <span class="sy0">=</span> <span class="kw2">new</span> Response<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">//Enforce a limit on the number of rows requested.</span>
    final integer QUERY_LIMIT <span class="sy0">=</span> <span class="nu0">500</span><span class="sy0">;</span>
    <span class="kw1">if</span><span class="br0">&#40;</span> qr.<span class="me1">start</span> <span class="sy0">&gt;=</span> QUERY_LIMIT <span class="br0">&#41;</span><span class="br0">&#123;</span>
        resp.<span class="me1">success</span> <span class="sy0">=</span> <span class="kw2">false</span><span class="sy0">;</span>
        resp.<span class="me1">errorMessage</span> <span class="sy0">=</span> <span class="st0">'Maximum number of records ('</span> <span class="sy0">+</span> String.<span class="me1">valueOf</span><span class="br0">&#40;</span>QUERY_LIMIT<span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">') exceeded!'</span><span class="sy0">;</span>
        <span class="kw1">return</span> resp<span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="kw1">try</span> <span class="br0">&#123;</span>
        getAllLeads<span class="br0">&#40;</span>qr<span class="sy0">,</span> resp<span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span>Exception e<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        resp.<span class="me1">success</span> <span class="sy0">=</span> <span class="kw2">false</span><span class="sy0">;</span>
        resp.<span class="me1">errorMessage</span> <span class="sy0">=</span> <span class="st0">'Query failed: '</span> <span class="sy0">+</span> e.<span class="me1">getMessage</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="kw1">return</span> resp<span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>This new version of the method is much simpler. First, it ensures the request has not exceeded the maximum query limit established for the application, and then it sets up and calls the new helper method which does all the real work.</p> 

<p>Save your changes to the Apex controller making sure it compiles correctly, and refresh your Sencha application in the browser; it should work exactly as before with the refactored Apex controller class.</p>

<h3>Step 3: Clean Up the Proxy Error Listener</h3>

<p>While I was running tests during development of the code for this part of the tutorial, I found some bugs in an error handling routine that we built out in the original posting of Part 2 of the series. If your code matches the original code below, please replace it now with the repaired version.</p>

<p>We had added a listener on the data proxy in the <code>init()</code> function of the PocketCRM.controller.Leads component to catch any errors passed back from the Apex controller. The original code below is flawed, and was not correctly displaying the error messages:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="co1">//THIS IS THE FLAWED CODE!</span>
<span class="co1">//Listen for exceptions observed by the proxy so we can report them and clean up.</span>
Ext.<span class="me1">getStore</span><span class="br0">&#40;</span><span class="st0">'Leads'</span><span class="br0">&#41;</span>.<span class="me1">getProxy</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">addListener</span><span class="br0">&#40;</span><span class="st0">'exception'</span><span class="sy0">,</span> <span class="kw2">function</span> <span class="br0">&#40;</span>proxy<span class="sy0">,</span> response<span class="sy0">,</span> operation<span class="sy0">,</span> options<span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co1">// only certain kinds of errors seem to have useful information returned from the server</span>
    <span class="kw1">if</span> <span class="br0">&#40;</span>response.<span class="me1">data</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">if</span> <span class="br0">&#40;</span>response.<span class="me1">data</span>.<span class="me1">errorMessage</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
            Ext.<span class="me1">Msg</span>.<span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Error'</span><span class="sy0">,</span> response.<span class="me1">data</span>.<span class="me1">errorMessage</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
            Ext.<span class="me1">Msg</span>.<span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Error'</span><span class="sy0">,</span> operation.<span class="me1">action</span> <span class="sy0">+</span> <span class="st0">' failed: '</span> <span class="sy0">+</span> response.<span class="me1">data</span>.<span class="me1">message</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
        Ext.<span class="me1">Msg</span>.<span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Error'</span><span class="sy0">,</span> operation.<span class="me1">action</span> <span class="sy0">+</span> <span class="st0">' failed for an unknown reason'</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;</pre>

<p>If your version is the flawed code, replace the original code with the repaired code as below that has corrected references to the response and operation objects, The improper references in the JavaScript were not actively breaking anything; the function was just failing silently, but will now properly report errors:</p> 

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="co1">//THIS IS THE REPAIRED CODE!</span>
<span class="co1">//Listen for exceptions observed by the proxy so we can report them and clean up.</span>
Ext.<span class="me1">getStore</span><span class="br0">&#40;</span><span class="st0">'Leads'</span><span class="br0">&#41;</span>.<span class="me1">getProxy</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">addListener</span><span class="br0">&#40;</span><span class="st0">'exception'</span><span class="sy0">,</span> <span class="kw2">function</span> <span class="br0">&#40;</span>proxy<span class="sy0">,</span> response<span class="sy0">,</span> operation<span class="sy0">,</span> options<span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co1">// only certain kinds of errors seem to have useful information returned from the server</span>
    <span class="kw1">if</span> <span class="br0">&#40;</span>response<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">if</span> <span class="br0">&#40;</span>response.<span class="me1">errorMessage</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
            Ext.<span class="me1">Msg</span>.<span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Error'</span><span class="sy0">,</span> response.<span class="me1">errorMessage</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
            Ext.<span class="me1">Msg</span>.<span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Error'</span><span class="sy0">,</span> operation.<span class="me1">config</span>.<span class="me1">action</span> <span class="sy0">+</span> <span class="st0">' failed: '</span> <span class="sy0">+</span> response.<span class="me1">errorMessage</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
        Ext.<span class="me1">Msg</span>.<span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Error'</span><span class="sy0">,</span> operation.<span class="me1">config</span>.<span class="me1">action</span> <span class="sy0">+</span> <span class="st0">' failed for an unknown reason'</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;</pre>

<p>Save your changes to the JavaScript and refresh your Sencha application in the browser to ensure no new errors were introduced; it should work exactly as before. You will see this routine in action if you page through the list requesting more records, and finally exceed the maximum number allowed by the query method. If you don&rsquo;t have enough leads to reach the ceiling, simply lower the limit from 500 to a smaller number to see the error handling behavior.</p>

<h3>Step 4: Add a Search Field to Filter the Leads</h3>

<p>Now that the new paging mechanism and query methods are in place, we can add a Search Field for a user to enter a partial Lead name to filter the query results. We have to add a few moving parts to get this working.</p>

<p>First, we need to modify the PocketCRM.view.LeadsList component, adding a Search Field on the toolbar docked at the bottom of the view. While we&rsquo;re at it, we&rsquo;ll also change the position of the refresh button and it's display icon, which will be used to execute a search after a user has entered some search text.</p> 

<p>The Search Field also has an embedded icon, (it appears as an x in a circle to the right of any entered text,) and when clicked or pressed, it clears the entered value. We will add a new listener and event handler on this icon so that when a user clears the search text, a refresh of the data is also fired off.</p>

<p>Since it&rsquo;s useful to know how many records a user has accumulated in the list, we&rsquo;ll also add a listener on the list itself, so that when it is refreshed or reactivated, we display the current record count as Badge Text on the refresh button. We could create a label somewhere on the toolbar to display this counter, but space is tight and this will give you an example of how you can set Badge Text on those components (such as buttons) that provide this feature.</p> 

<p>Find the JavaScript for the PocketCRM.view.LeadsList component and modify the following code sections. First, find the code for the bottom toolbar in the Items configuration and replace it with the code below. This adds an itemId, a SearchField component, and adjusts the layout of these items with additional spacers. Notice also that we have changed the iconCls of the syncButton component to display a Search rather than a Refresh icon:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
...		
<span class="br0">&#123;</span>
    xtype<span class="sy0">:</span> <span class="st0">&quot;toolbar&quot;</span><span class="sy0">,</span>
    docked<span class="sy0">:</span> <span class="st0">&quot;bottom&quot;</span><span class="sy0">,</span>
    itemId<span class="sy0">:</span> <span class="st0">&quot;bottomToolBar&quot;</span><span class="sy0">,</span>
&nbsp;
    items<span class="sy0">:</span> <span class="br0">&#91;</span>
        <span class="br0">&#123;</span>
            xtype<span class="sy0">:</span> <span class="st0">'spacer'</span>
        <span class="br0">&#125;</span><span class="sy0">,</span>                  
        <span class="br0">&#123;</span>  
            xtype<span class="sy0">:</span> <span class="st0">'searchfield'</span><span class="sy0">,</span>                            
            itemId<span class="sy0">:</span><span class="st0">'leadSearchField'</span><span class="sy0">,</span>  
            placeHolder<span class="sy0">:</span> <span class="st0">'Name Contains...'</span>  
        <span class="br0">&#125;</span><span class="sy0">,</span>                  
        <span class="br0">&#123;</span>
            xtype<span class="sy0">:</span> <span class="st0">&quot;button&quot;</span><span class="sy0">,</span>
            iconCls<span class="sy0">:</span> <span class="st0">&quot;search&quot;</span><span class="sy0">,</span>
            iconMask<span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span>
            itemId<span class="sy0">:</span> <span class="st0">&quot;syncButton&quot;</span>
        <span class="br0">&#125;</span><span class="sy0">,</span>	
        <span class="br0">&#123;</span>
            xtype<span class="sy0">:</span> <span class="st0">'spacer'</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#93;</span>
<span class="br0">&#125;</span><span class="sy0">,</span>
...
&nbsp;</pre>

<p>Next, find the <code>listeners</code> configuration, and add these additional listeners after the one for the #leadslist delegate:</p> 

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
...	
<span class="me1">listeners</span><span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
...
    <span class="sy0">,</span><span class="br0">&#123;</span>
        <span class="co1">//Handles the clear of the Search Field.      		</span>
        delegate<span class="sy0">:</span> <span class="st0">&quot;#leadSearchField&quot;</span><span class="sy0">,</span>
        event<span class="sy0">:</span> <span class="st0">&quot;clearicontap&quot;</span><span class="sy0">,</span>
        fn<span class="sy0">:</span> <span class="st0">&quot;onLeadSearchFieldClearIconTap&quot;</span>
    <span class="br0">&#125;</span><span class="sy0">,</span>
    <span class="br0">&#123;</span>
        <span class="co1">//Handles the refresh of the list.      		</span>
        delegate<span class="sy0">:</span> <span class="st0">&quot;#leadsList&quot;</span><span class="sy0">,</span>
        event<span class="sy0">:</span> <span class="st0">&quot;refresh&quot;</span><span class="sy0">,</span>
        fn<span class="sy0">:</span> <span class="st0">&quot;onLeadsListRefresh&quot;</span><span class="sy0">,</span>
    <span class="br0">&#125;</span><span class="sy0">,</span>
    <span class="br0">&#123;</span>
        <span class="co1">//Handles the activate of the view when redisplayed by transition.</span>
        event<span class="sy0">:</span> <span class="st0">&quot;activate&quot;</span><span class="sy0">,</span>
        fn<span class="sy0">:</span> <span class="st0">&quot;onLeadsListViewActivate&quot;</span><span class="sy0">,</span>
<span class="br0">&#125;</span><span class="br0">&#93;</span>
&nbsp;</pre>

<p>Finally, add the new functions for each of the new listeners after the final function for the <code>onLeadsListDisclose</code> event, (be sure to precede the new set of functions with a comma delimiter:)</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
onLeadSearchFieldClearIconTap<span class="sy0">:</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;clearSearchLeadCommand&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">this</span>.<span class="me1">fireEvent</span><span class="br0">&#40;</span><span class="st0">'clearSearchLeadCommand'</span><span class="sy0">,</span> <span class="kw1">this</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">,</span>
&nbsp;
onLeadsListRefresh<span class="sy0">:</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;onLeadsListRefresh&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">this</span>.<span class="me1">updateListCounter</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">,</span>
&nbsp;
onLeadsListViewActivate<span class="sy0">:</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;onLeadsListViewActivate&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">this</span>.<span class="me1">updateListCounter</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">,</span>
&nbsp;
<span class="co1">//Function to get count of records in the list and show on the search button's badge. </span>
updateListCounter<span class="sy0">:</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="kw2">var</span> listCount <span class="sy0">=</span> Ext.<span class="me1">getStore</span><span class="br0">&#40;</span><span class="st0">&quot;Leads&quot;</span><span class="br0">&#41;</span>.<span class="me1">getCount</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">this</span>.<span class="me1">getComponent</span><span class="br0">&#40;</span><span class="st0">&quot;bottomToolBar&quot;</span><span class="br0">&#41;</span>.<span class="me1">getComponent</span><span class="br0">&#40;</span><span class="st0">&quot;syncButton&quot;</span><span class="br0">&#41;</span>.<span class="me1">setBadgeText</span><span class="br0">&#40;</span>listCount<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>We will add the event handler logic for the <code>clearSearchLeadCommand</code> in the controller shortly. The final function in the set (<code>updateListCounter</code>) is called from both the <code>onLeadsListRefresh</code> and <code>onLeadsListViewActivate</code> event handler functions, and contains logic to update the Badge Text of the syncButton with the current record count. Note how it gets the record count from the data store, and sets the value to the Badge Text of the syncButton in the bottomToolBar component. This is just one example of how to obtain references to components and get/set values within functions.</p>

<p>Save your changes and refresh your Sencha application in the browser to ensure no errors were introduced. You should now see the new Search Field and adjusted button and record count. You can enter a search value, but it won&rsquo;t yet apply the filter when you reload the list.</p>

<p><img src="http://cdn.sencha.io/img/20130408-force-p3/SenchaForcePart3_Image02.png" class="rounded shadow aligncenter" alt="Sencha + SFDC"></p>

<h3>Step 5: Refactor the Load to Include the Search Value</h3>

<p>We have to modify our reload logic to include the new search value. As this logic is called from more than one place in our code, it will be best to isolate into its own function, and then call as needed from other functions. We&rsquo;ll also have to make a few other supporting modifications to the PocketCRM.controller.Leads component.</p>

<p>First, we need to add a new controller reference for the new Search Field in the controller&rsquo;s <code>refs</code> configuration section, it will look like this:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
refs<span class="sy0">:</span> <span class="br0">&#123;</span>
    ...
    <span class="co1">//Add a new search field.</span>
    leadsListSearchField<span class="sy0">:</span> <span class="st0">&quot;#leadSearchField&quot;</span> 
<span class="br0">&#125;</span><span class="sy0">,</span>
&nbsp;</pre>

<p>Next, we need to add a new control for the new event fired by List View&rsquo;s event handler function on the Search Field&rsquo;s clear icon. It will be added in the <code>control</code> configuration section, and will look like this, (make sure to add a comma delimiter after any configuration that precedes the new <code>clearSearchLeadCommand</code>):</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
control<span class="sy0">:</span> <span class="br0">&#123;</span>
    leadsListView<span class="sy0">:</span> <span class="br0">&#123;</span>
        <span class="co1">// The commands fired by the list container.</span>
        ...
        <span class="sy0">,</span>
        <span class="co1">//Add an event when clearing the search text.</span>
        clearSearchLeadCommand<span class="sy0">:</span> <span class="st0">&quot;onClearSearchLeadCommand&quot;</span>
<span class="br0">&#125;</span><span class="sy0">,</span>
&nbsp;</pre>

<p>Now we must add the logic to manage the reload of the data, and include any search values entered by the user. Once this function is available, we will call it from a number of other event handlers. Add the new function below all the other event handler functions, but above the launch function:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="co1">//Add separate load function to be called by multiple event handlers.</span>
loadList<span class="sy0">:</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
    <span class="co1">//Get a ref to the store and remove it.</span>
    <span class="kw2">var</span> leadsStore <span class="sy0">=</span> Ext.<span class="me1">getStore</span><span class="br0">&#40;</span><span class="st0">&quot;Leads&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">//Get any search text.</span>
    <span class="kw2">var</span> leadSearchField <span class="sy0">=</span> <span class="kw1">this</span>.<span class="me1">getLeadsListSearchField</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw2">var</span> searchText <span class="sy0">=</span> leadSearchField.<span class="me1">getValue</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> 
&nbsp;
    <span class="co1">//Validate for at least 2 or more characters.</span>
    <span class="kw1">if</span> <span class="br0">&#40;</span>searchText.<span class="me1">length</span> <span class="sy0">&gt;</span> <span class="nu0">0</span> <span class="sy0">&amp;&amp;</span> searchText.<span class="me1">length</span> <span class="sy0">&lt;</span> <span class="nu0">2</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw2">var</span> msg <span class="sy0">=</span> <span class="st0">'Search requires more text.'</span><span class="sy0">;</span>
        Ext.<span class="me1">Msg</span>.<span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'Please correct errors!'</span><span class="sy0">,</span> msg<span class="sy0">,</span> Ext.<span class="me1">emptyFn</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="kw1">return</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="co1">//Add wild cards to the search string.	</span>
    <span class="kw1">if</span> <span class="br0">&#40;</span>searchText <span class="sy0">!=</span> <span class="st0">''</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="co1">//Surround the search value with wildcards for SOQL LIKE search.</span>
        searchText <span class="sy0">=</span> <span class="st0">'%'</span> <span class="sy0">+</span> searchText <span class="sy0">+</span> <span class="st0">'%'</span><span class="sy0">;</span> 
    <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
        <span class="co1">//Set wildcard for wide open filter.	</span>
        searchText <span class="sy0">=</span> <span class="st0">'%'</span><span class="sy0">;</span> 
    <span class="br0">&#125;</span>
&nbsp;
    <span class="co1">//Set the value of the searchFilter param to pass with the request for the query.</span>
    <span class="kw2">var</span> model <span class="sy0">=</span> Ext.<span class="me1">ModelMgr</span>.<span class="me1">getModel</span><span class="br0">&#40;</span><span class="st0">'PocketCRM.model.Lead'</span><span class="br0">&#41;</span><span class="sy0">;</span>
    model.<span class="me1">getProxy</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">setExtraParam</span><span class="br0">&#40;</span><span class="st0">'searchFilter'</span><span class="sy0">,</span> searchText<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">//Clear all data in the store before reloading it.</span>
    <span class="co1">//This is necessary to make sure that the proxy doesn't get confused by </span>
    <span class="co1">//the loss of records removed but not reloaded with a new filter. </span>
    <span class="co1">//Without the clear(), the proxy assumes a deletion was processed and </span>
    <span class="co1">//calls a destroy to be executed on missing records with the next sync() operation.</span>
    leadsStore.<span class="me1">getData</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">clear</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>	
    leadsStore.<span class="me1">loadPage</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span> 
&nbsp;
    <span class="co1">//Show the list.</span>
    <span class="kw1">this</span>.<span class="me1">activateLeadsList</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">,</span>
&nbsp;</pre>

<p>Add the following new function to handle the search field clear event, place it after the <code>onBackToHome</code> event handler:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="co1">//Reload the list when clearing the search value. </span>
onClearSearchLeadCommand<span class="sy0">:</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;onClearSearchLeadCommand&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">//Get a ref to the search field. </span>
    <span class="kw2">var</span> leadSearchField <span class="sy0">=</span> <span class="kw1">this</span>.<span class="me1">getLeadsListSearchField</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    leadSearchField.<span class="me1">setValue</span><span class="br0">&#40;</span><span class="st0">''</span><span class="br0">&#41;</span><span class="sy0">;</span>
    console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;Cleared Field Value: &quot;</span> <span class="sy0">+</span> leadSearchField.<span class="me1">getValue</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>        
&nbsp;
    <span class="kw1">this</span>.<span class="me1">loadList</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">,</span> 
&nbsp;</pre>

<p>Modify the following event handler functions to also call the new load function:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
onSyncLeadCommand<span class="sy0">:</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;onSyncLeadCommand&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">this</span>.<span class="me1">loadList</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">,</span>
&nbsp;
...
<span class="me1">launch</span><span class="sy0">:</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;launch&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">this</span>.<span class="me1">callParent</span><span class="br0">&#40;</span>arguments<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">//Load up the Store associated with the controller and its views. </span>
    console.<span class="me1">log</span><span class="br0">&#40;</span><span class="st0">&quot;load Leads&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">this</span>.<span class="me1">loadList</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">,</span>
&nbsp;</pre>

<p>Remember to take care to include all commas and curly braces as needed or your JavaScript will break. This was a lot of code to change, hopefully we will not have introduced any errors. Save your changes and refresh your Sencha application in the browser to ensure all is well.</p> 

<p>Now, enter a search value into the new Search Field and click the search button. If all your changes are working properly, the list should refresh showing only records matching your search criteria. If there are more records matching your search than the default page size, you should be able to load additional records by clicking the &ldquo;Load More...&rdquo; link. Continue to fetch more records until you see the &ldquo;No More Records&rdquo; message. If the number of records you have loaded into the list exceeds the maximum as configured in the Apex controller&rsquo;s Query method, you should see an error message alert, (thanks to our repaired Apex error listener.)</p>

<p><img src="http://cdn.sencha.io/img/20130408-force-p3/SenchaForcePart3_Image03.png" class="rounded shadow aligncenter" alt="Sencha + SFDC"></p>

<p>Clicking the clear icon in the Search Field should remove the search value from the text box and refresh the list with the original record set displayed. In each case, you should see the record counter change in the search button&rsquo;s Badge Text. To ensure that the counter refresh events are also working properly after CRUD operations, try to add and then delete a new lead. Each time the List is re-displayed following such an operation, you should see the record counter adjust correctly reflecting the newly added or removed record in the count.</p>

<p>Using the Web Inspector developer tool from Safari, you can trace the proxy request when the search and reload operations are executed. You can inspect the JSON request payload sent to the Salesforce remoting service which should look like this for a search, note the value of the searchFilter which includes the SOQL wildcards:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="br0">&#123;</span>
    <span class="st0">&quot;action&quot;</span><span class="sy0">:</span> <span class="st0">&quot;PocketCRMLeadController&quot;</span><span class="sy0">,</span>
    <span class="st0">&quot;method&quot;</span><span class="sy0">:</span> <span class="st0">&quot;Query&quot;</span><span class="sy0">,</span>
    <span class="st0">&quot;data&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
            <span class="st0">&quot;searchFilter&quot;</span><span class="sy0">:</span> <span class="st0">&quot;%22%&quot;</span><span class="sy0">,</span>
            <span class="st0">&quot;start&quot;</span><span class="sy0">:</span> <span class="nu0">0</span><span class="sy0">,</span>
            <span class="st0">&quot;recordCount&quot;</span><span class="sy0">:</span> <span class="nu0">25</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#93;</span><span class="sy0">,</span>
    <span class="st0">&quot;type&quot;</span><span class="sy0">:</span> <span class="st0">&quot;rpc&quot;</span><span class="sy0">,</span>
    <span class="st0">&quot;tid&quot;</span><span class="sy0">:</span> <span class="nu0">8</span><span class="sy0">,</span>
    <span class="st0">&quot;ctx&quot;</span><span class="sy0">:</span> <span class="br0">&#123;</span>
        <span class="st0">&quot;csrf&quot;</span><span class="sy0">:</span> <span class="st0">&quot;rUvT8gN3e0D50m2xK4bzRzvhRMlOLqNZFO6QZu3l2T.D2NrF6T0VUggRNmn4ssjNER_At7gsWui4U2yWpxSnzXzawt2Dn6jhpM2ez15tL5ztVihbH63dBQ.2F4c29tY4QYuAWtSuZreRdWbl1hGz67ZH1q3RI2m6By2201K6g6sVdrVF&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;vid&quot;</span><span class="sy0">:</span> <span class="st0">&quot;06650000000DAsF&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;ns&quot;</span><span class="sy0">:</span> <span class="st0">&quot;&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;ver&quot;</span><span class="sy0">:</span> <span class="nu0">24</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>Each request for more data will increase the <code>start</code> property. Here&rsquo;s what it looks like for a request of the third page with no filter value, (note the passed wildcard character for an empty search value:)</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="br0">&#123;</span>
    <span class="st0">&quot;action&quot;</span><span class="sy0">:</span> <span class="st0">&quot;PocketCRMLeadController&quot;</span><span class="sy0">,</span>
    <span class="st0">&quot;method&quot;</span><span class="sy0">:</span> <span class="st0">&quot;Query&quot;</span><span class="sy0">,</span>
    <span class="st0">&quot;data&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
            <span class="st0">&quot;searchFilter&quot;</span><span class="sy0">:</span> <span class="st0">&quot;%&quot;</span><span class="sy0">,</span>
            <span class="st0">&quot;start&quot;</span><span class="sy0">:</span> <span class="nu0">50</span><span class="sy0">,</span>
            <span class="st0">&quot;recordCount&quot;</span><span class="sy0">:</span> <span class="nu0">25</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#93;</span><span class="sy0">,</span>
    <span class="st0">&quot;type&quot;</span><span class="sy0">:</span> <span class="st0">&quot;rpc&quot;</span><span class="sy0">,</span>
    <span class="st0">&quot;tid&quot;</span><span class="sy0">:</span> <span class="nu0">11</span><span class="sy0">,</span>
    <span class="st0">&quot;ctx&quot;</span><span class="sy0">:</span> <span class="br0">&#123;</span>
        <span class="st0">&quot;csrf&quot;</span><span class="sy0">:</span> <span class="st0">&quot;rUvT8gN3e0D50m2xK4bzRzvhRMlOLqNZFO6QZu3l2T.D2NrF6T0VUggRNmn4ssjNER_At7gsWui4U2yWpxSnzXzawt2Dn6jhpM2ez15tL5ztVihbH63dBQ.2F4c29tY4QYuAWtSuZreRdWbl1hGz67ZH1q3RI2m6By2201K6g6sVdrVF&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;vid&quot;</span><span class="sy0">:</span> <span class="st0">&quot;06650000000DAsF&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;ns&quot;</span><span class="sy0">:</span> <span class="st0">&quot;&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;ver&quot;</span><span class="sy0">:</span> <span class="nu0">24</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<h3>Summary</h3>

<p>Let's recap what we accomplished:</p>

<ol>
  <li>We added a Sencha ListPaging plugin to provide &ldquo;scroll down&rdquo; paging to automatically fetch more records when a user scrolls to the bottom of the list. There are other plugins available with similar but alternate behavior, some provide next and previous paging, others provide a &ldquo;Pull Down&rdquo; type fetch. If you want to get adventurous, you can even write your own.</li>
  <li>We redesigned the querying capability of our Apex controller class to provide efficient data paging using SOQL OFFSET and a search filter, and we set an upper limit on the number of records that can be fetched by the client application.</li>
  <li>We added a Search Field in the list view, allowing a user to filter records fetched from Salesforce by a search on any portion of a Lead&rsquo;s first or last name. You can also rewrite the Apex controller to use SOSL for a fulltext search, or build out a more complex dynamic query capability.</li>
  <li>We added the display of a record count reflecting the current list content that refreshes with each reload of data.</li>  
  <li>Finally, we fixed a bug in the data proxy listener to properly display errors returned from our Apex controller.</li>
</ol>

<p>You can find the <a href="https://gist.github.com/a1399a77150b7a2e1304">full code for the completed application for Part 3 here at GitHub</a>.</p>

<h3>Closure</h3>

<p>In the next part or our series, we'll expand our application to provide an appropriate user interface for a tablet device, in addition to a phone, by leveraging the Sencha Touch profile feature. This feature adds the capability to identify the device type loading the application, permitting a single code base to support multiple form factors. By isolating alternate sets of components to support different devices, applications can also share larger collections of components for common functionality in the remainder of the codebase.</p>

<p>In the meantime, I encourage you to continue your Force.com and Sencha Touch mobile ramp-up by watching videos, playing with and dissecting samples, and reading through the great online guidance documentation. You should now also have enough knowledge under your belt to build a simple application of your own using all the design patterns from the tutorial to date. Also, definitely check out the features and functions of the recently announced Salesforce Touch Platform; you can go <a href="http://blogs.developerforce.com/developer-relations/2012/09/introducing-the-salesforce-touch-platform-guide.html" >here to download a free eBook</a> and read all about it.</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Thu, 09 May 2013 11:40 GMT</pubDate>
        <guid>http://www.sencha.com/blog/developing-mobile-applications-with-force.com-and-sencha-touch-part-3/#date:11:40</guid>
        </item>
        
        <item>
        <title>7 Overlooked Features of Sencha Architect</title>
        <author>Patrick  Chu</author>
        <description>
            Sencha Architect is a visual development tool that can greatly boost your Sencha programming productivity. You can use it to rapidly create both Ext JS and Sencha Touch applications. Check out these 7 overlooked shortcuts in Sencha Architect.
        </description>
        <link>http://www.sencha.com/blog/7-overlooked-features-of-sencha-architect/</link>
        <content:encoded>
            <![CDATA[
                <p>Sencha Architect is a visual development tool that can greatly boost your Sencha programming productivity. You can use it to rapidly create both Ext JS and Sencha Touch applications.</p>

<p>Knowing these 7 productivity-enhancing features can make you even more productive than you already are!</p>

<h3>1. Property filter keyboard shortcut: Ctrl-E (&#8984;-E on Macs)</h3>

<p><center>
<img src="http://img1.sencha.com/files/misc/arch-overlook-1.png" alt="Ctrl-E" height="265" width="400"  />
</center></p>

<h4>How it&#8217;s done</h4>

<p>Type Ctrl-E (&#8984;-E on Macs) to place the cursor in the config/property filter field.</p>

<h4>Discussion</h4>

<p>I&#8217;m always using the property filter to narrow down what is often a huge list of config properties into three or four that I can quickly click on and edit.</p>

<p>Here&#8217;s the editing sequence that I use a lot:</p>

<ol>
<li>Click on a component in the Project Inspector</li>
<li>Type <strong>Ctrl-E</strong> to put the cursor in the property filter</li>
<li>Type two or three characters to narrow down the list of configs</li>
<li>Edit the property that I want to change</li>
</ol>

<h3>2. Lock the filter</h3>

<p><center>
<img src="http://img1.sencha.com/files/misc/arch-overlook-2.png" alt="Lock the Filter" height="470" width="350"  />
</center></p>

<h4>How it&#8217;s done</h4>

<p>Click the &#8220;lock&#8221; icon in the config/property field. This will lock the current filter in place as you click on different items in the Project Inspector.</p>

<h4>Discussion</h4>

<p>You may have noticed that when you click on a new item in the Project Inspector or in design view, the filter is not applied until you type &#8220;Ctrl-E (or &#8984;-E)&#8221; and then ENTER. However, if you click the &#8220;lock&#8221; icon in the filter area, your filter will be applied automatically as you change items.</p>

<p>You can use this feature to quickly edit the same feature on many similar items. For example, you can type &#8220;align&#8221; in the filter field (or even &#8220;al&#8221;), then click on the grid columns where you want to change the alignment.</p>

<h3>3. Collapse the Toolbox categories or the entire Toolbox</h3>

<p><center>
<img src="http://img1.sencha.com/files/misc/arch-overlook-3a.png" alt="Collapse toolbox categories" height="400" width="300"  />
&nbsp;&nbsp;&nbsp;
<img src="http://img1.sencha.com/files/misc/arch-overlook-3b.png" alt="Collapse entire Toolbox" height="400" width="180"  />
</center></p>

<h4>How it&#8217;s done</h4>

<p>To close just the Toolbox categories, click the little arrow (barely visible) about halfway down the categories splitter. To close the entire Toolbox, click the arrow at the far right side of the Toolbox header.</p>

<h4>Discussion</h4>

<p>I almost always keep the Toolbox categories pane hidden. I keep &#8220;Everything&#8221; selected and then filter for what I need. After hiding the categories, you can then reduce the Toolbox&#8217;s width to give yourself more room.</p>

<p>If you need even more space, you can collapse the Toolbox completely by clicking on the collapse arrow on the right-hand side.</p>

<h3>4. Add a reference to an external Third Party JavaScript API</h3>

<p><center>
<img src="http://img1.sencha.com/files/misc/arch-overlook-4a.png" alt="Adding a Javascript resource" height="309" width="299"  />
&nbsp;&nbsp;&nbsp;
<img src="http://img1.sencha.com/files/misc/arch-overlook-4b.png" alt="Editing a Javascript resource" height="303" width="289"  />
</center></p>

<h4>How it&#8217;s done</h4>

<p>Click on the [+] button in the Project Inspector, click on &#8220;Resource&#8221;, then click the &#8220;JS Resource&#8221; sub-menu item.</p>

<h4>Discussion</h4>

<p>When you add a reference to an external JavaScript API in Sencha Architect, you can then call those library functions from anywhere in your Architect application. Some examples of the hundreds of third party JavaScript libraries available include Google Maps, Google Analytics and jQuery.</p>

<p>If you want to see a fully functioning Google Maps Tab Panel in an Architect app written in about 30 lines of code, add a comment below, and I&#8217;ll be happy to cover this in a future blog article.</p>

<h3>5. Promote to Class</h3>

<p><center>
<img src="http://img1.sencha.com/files/misc/arch-overlook-5.png" alt="Promote to class" height="506" width="301"  />
</center></p>

<h4>How it&#8217;s done</h4>

<p><strong>RIGHT-CLICK</strong> on the container or component that you want to promote (i.e., save to a separate class file). Choose &#8220;Promote to Class&#8221; from the context menu.</p>

<h4>Discussion</h4>

<p>When you first start building your Sencha Architect application, you add components to the viewport or to a Tab Panel. As you start adding more components, the items array of these containers becomes unwieldy, and at that point it&#8217;s best to create separate classes for your bigger components.</p>

<p>When you create a separate class, you assign it a custom xtype, which will be used to reference your class in the parent&#8217;s item array. You can also use the custom xtype in a ref selection or a ComponentQuery.query() call in your controller.</p>

<h3>6. Add a Store without a Proxy attached</h3>

<p><center>
<img src="http://img1.sencha.com/files/misc/arch-overlook-6.png" alt="Create Store without a Proxy" height="362" width="300"  />
</center></p>

<h4>How it&#8217;s done</h4>

<p>To create a Store with no proxy attached, click the top level &#8220;Store&#8221; after clicking the [+] button in the Project Inspector, as shown in the screen shot above.</p>

<h4>Discussion</h4>

<p>Normally, when you click the [+] button and then hover over the &#8220;Store&#8221; menu item, you will see a list of different Stores in the sub-menu. Whichever Store you choose will have a proxy attached to it.</p>

<p>Sometimes you&#8217;ll want to create a Store without a proxy attached, maybe because you already have a proxy attached to your model. Clicking on the top-level Store menu item adds a Store without a proxy attached.</p>

<h4>Additional Notes</h4>

<p>A &#8220;proxy&#8221;, when attached to either the Model or the Store, is how you define where the API resides. The &#8220;url&#8221; and &#8220;type&#8221; (json and xml types are built in) properties are required.</p>

<p>When would you attach a proxy to a Model versus a Store? If you are using the Model.save() method and creating Models instances individually, then you would attach the proxy to the Model.</p>

<h3>7. List Tabs keyboard shortcut: Ctrl-L (&#8984;-L on Macs) &#8211; New for version 2.2!</h3>

<p><center>
<img src="http://img1.sencha.com/files/misc/arch-overlook-7.png" alt="List open tabs with Ctrl-L" height="351" width="492"  />
</center></p>

<h4>How it&#8217;s done</h4>

<p>Type Ctrl-L (&#8984;-L on Macs) to see a list of currently open tabs. Arrow up and down to move within the listing, and hit ENTER to select and focus a tab.</p>

<h4>Discussion</h4>

<p>New for Sencha Architect 2.2: each class in your Architect application can be placed in its own tab. This allows you to quickly edit different areas of your application (for example, a grid and its associated store) without having to scroll back and forth in your Project Inspector. You can close tabs at any time.</p>

<p>The problem arises when you have more tabs than can fit in the tab area. The solution is to type &#8220;Ctrl-L (&#8984;-L on Macs)&#8221; to list all open tabs. (You can also click on the &#8220;List Tabs&#8221; icon on the right side of your tab area.)</p>

<p>Then, using your up and down arrow keys, you can quickly navigate to a tab and hit ENTER to focus that tab. For now, you can&#8217;t move tabs by dragging them, but you can close and re-open tabs if you want to change the order and put related tabs near each other.</p>

<h3>Conclusion</h3>

<p>I hope that some of these features are new to you, and that this article helps to save you some time.</p>

<p>The Sencha Architect features covered here are only a tiny fraction of what&#8217;s available. Sencha Architect is covered in great detail in the 5-day Ext JS and Sencha Touch classes offered all over the world through Sencha Training, taught by Sencha-certified instructors. Visit <a href="http://www.sencha.com/training/"><strong>sencha.com/training</strong></a> for more details.</p>

<p>If you have any feedback, please add it to the comments section.</p>

                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Wed, 08 May 2013 16:35 GMT</pubDate>
        <guid>http://www.sencha.com/blog/7-overlooked-features-of-sencha-architect/#date:16:35</guid>
        </item>
        
        <item>
        <title>BlackBerry 10: The HTML5 Scorecard</title>
        <author>Michael Mullany</author>
        <description>
            In our last HTML5 scorecard, we took a look at the Microsoft Surface vs. the iPad gen4 and gave our nod to the iPad as the best HTML5 platform on tablets. This time, we&amp;rsquo;re putting the just launched BlackBerry Z10 running the new BlackBerry 10 OS through the test wringer.
        </description>
        <link>http://www.sencha.com/blog/blackberry-10-the-html5-scorecard/</link>
        <content:encoded>
            <![CDATA[
                <p><img src="http://cdn.sencha.io/img/20130501-bb10/bbz10-hero-angled.jpg" class="alignright">In our last HTML5 scorecard, we took a look at the <a href="http://www.sencha.com/blog/microsoft-surface-vs-the-ipad-gen-4-the-html5-scorecard/" target="_new">Microsoft Surface vs. the iPad</a> gen4 and gave our nod to the iPad as the best HTML5 platform on tablets. This time, we&rsquo;re putting the just launched BlackBerry Z10 running the new BlackBerry 10 OS through the test wringer. Going in, we were expecting very good things from the Z10. Last year, we gave a thumbs up to the Playbook OS2 HTML5 experience, and had good experiences with pre-release versions of the Z10 when developing Sencha Touch 2.2. So, prejudices firmly in mind, we headed out to a Best Buy and got ourselves a Z10 for scorecard testing. </p>

<p>In our tests, we found that the Z10 is a worthy addition to the top tier of mobile HTML5 devices that includes the iPhone 4+, the iPad gen 2/4 and the Microsoft Surface. We found solid advances in HTML5 feature implementation and very good performance in general. Most exciting to us is the support for getUserMedia(), which allows streaming video capture directly from the browser. We think BlackBerry&rsquo;s UI for video capture is nicely designed. We did find a few feature glitches in our version 10.0 device that we expect to be cleaned up in the 10.1 release. </p>

<p>Our HTML5 scorecard consists of a series of tests aimed to help mobile web developers understand new devices and new form factors as they come to market. Since the feature scope of HTML5 is enormous, we focus on testing newer features and graphics and animation performance. We use a variety of homegrown and third party test-sites, including modernizr, html5test, html5rocks, haz.io, and in-the-wild web demos to check feature presence and correctness. </p>

<h3>Device Essentials</h3>

<p>First up, some essentials for the web developer. If you&rsquo;re looking for traffic from the Z10 (or the forthcoming Q10, search for the following user agent string:</p>

<p style="margin-left:20px;">Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko)<br/>Version/10.0.10.822 Mobile Safari/537.10+</p>
<p>The Z10 supports at least 10 simultaneous touches, which we gamely verified by cramming our fingers and thumbs onto the test screen. Multiple touches were very reliable up to 4 simultaneous touches: above that new touches and a move of an existing touch seemed to get a little mixed up. Since there are practically no applications that rely on more than 4 fingers on a screen, this is just fine. </p>

<blockquote class="pullquote" style="font-size:25px; width:312px;"><p><span>&ldquo;</span>In our tests, we found that the Z10 is a worthy addition to the top tier of mobile HTML5 devices that includes the iPhone 4+, the iPad gen 2/4 and the Microsoft Surface.&rdquo;</p>
</blockquote>

<p>Next, JavaScript timer resolution. BlackBerry has changed its default timer resolution from 17ms to 4ms in this release. This is the same interval supported by iOS and desktop browsers, so script animations paced by a setTimeout() loop will now run at the same pace (last we checked Android was still at anywhere from 4s to 17s though). The timer is a little noisy with occasional spikes to 20ms or more, so the even better news is that BB10 now supports requestAnimationFrame so animation can be smoother and more efficient. </p>

<h3>HTML5 Features</h3>
<p>The Z10 has a very complete set of HTML5 features, scoring 485 on the current html5test.com feature test. New this year is IndexedDB, File API, Microdata, in-browser WebGL, some new HTML5 form features, getUserMedia(), as well as support for the Ogg audio codecs Ogg Vorbis and Ogg Opus. </p>

<p>What deserves showcasing is the Z10&rsquo;s WebGL support: it&rsquo;s pretty darn good. The standard <a href="http://www.khronos.org/webgl/wiki/Demo_Repository" target="_new">WebGL demos</a> worked extremely well. We were excited to see the many planets animated demo running happily at 35fps. In fact, the only demo that showed any noticeable stutter was Mozilla&rsquo;s animated raytracing demo. </p>

<figure style="text-align:center;margin-bottom:20px;">
<img src="http://cdn.sencha.io/img/20130501-bb10/bbz10-webgl.jpg">
<figcaption style="text-align:center;">Khronos Group&rsquo;s Many Planets demo (35fps!)</figcaption>
</figure>

<p>In addition to WebGL, the new audio codecs played perfectly, and <a href="http://benvinegar.github.io/seamless-talk/#/12" target="_new">seamless iframes</a> displayed correctly. We also tested getUserMedia() and it worked correctly for video capture (although audio-only is not supported yet).</p>

<p>On the other hand, we found some bugs in other newly implemented features. IndexedDB demos did not run correctly or crashed the browser. The <a href="http://w3c-test.org/html/tests/submission/Opera/microdata/001.html" target="_new">W3C test page</a> for Microdata crashed, and scoped styles did not appear to work in <a href="http://jsfiddle.net/fa7PN/" target="_new">a minimal demo</a>. We talked to BlackBerry, and found out that all three bugs are being investigated already and should be fixed in dot releases. Lastly and as a side note, some of the built-in HTML5 form inputs look like they were ported directly from the Playbook OS without adjustment for the smaller screen of the Z10. For example, the HTML5 color input was not sized correctly and we had to scroll within the control in order to select colors. </p>

<h3>Graphics &amp; Animation Performance</h3>

<p>In real world tests, Canvas and SVG performance was respectable. <a href="http://www.effectgames.com/demos/canvascycle/" target="_new">Canvas color cycle</a> was very smooth. In <a href="http://ie.microsoft.com/testdrive/performance/fishbowl/" target="_new">Microsoft&rsquo;s fishbowl demo</a> which stresses the compositor, with 50 fish sprites and the fps meter active, we got 50fps. With all effects active, the performance dropped to 20 fps. Zynga&rsquo;s informal goal for casual games is 125 sprites at 60fps, so Canvas could be a little better. CSS3 animation demos worked well, handling multiple simultaneous animations smoothly and consistently. CSS filter shorthands as well as more complex SVG filters were also properly supported. We did find some SVG regressions: a problem with SVG filter light sources, malfunctioning gradient animations and a crash with David Dailey&rsquo;s classic <a href="http://srufaculty.sru.edu/david.dailey/svg/balloon.svg" target="_new">SVG floating balloon</a>. Talking to BlackBerry, many SVG bugs are fixed and will roll out in dot releases.</p>

<p>Finally, we&rsquo;re happy to say that BlackBerry continues to have a fantastic implementation of position: fixed, and overflow scrolling. It&rsquo;s rock solid. </p>

<h3>A Solid Upgrade to an Already Fine HTML5 Browser</h3>
<p>With the release of BlackBerry Z10, the BlackBerry browser team once again delivers a very solid HTML5 platform. An industry leading HTML5 score, solid WebGL performance and a terrific getUserMedia implementation are the standouts for us. With the forthcoming performance and bug fixes, the Z10 has a solid shot at being the best mobile platform for HTML5 app deployment. </p>


                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Thu, 02 May 2013 15:00 GMT</pubDate>
        <guid>http://www.sencha.com/blog/blackberry-10-the-html5-scorecard/#date:15:00</guid>
        </item>
        
        <item>
        <title>The Unconference Unmasked</title>
        <author>Arthur Kay</author>
        <description>
            We are trying something different and very cool this year at SenchaCon 2013 in Orlando in July &amp;mdash; a mini-unconference! Some of you may be familiar with unconferences (also known as &amp;ldquo;open spaces&amp;rdquo;, &amp;ldquo;birds of a feather&amp;rdquo;, etc) &amp;mdash; but for those of you who are not, an unconference consists of unstructured sessions that are determined and hosted by you, the conference attendees.
        </description>
        <link>http://www.sencha.com/blog/the-unconference-unmasked/</link>
        <content:encoded>
            <![CDATA[
                <p>We have added something new and powerful to the already strong agenda at <a href="http://www.senchacon.com" target="_new">SenchaCon 2013</a> in Orlando in July &mdash; a mini-unconference! Some of you may be familiar with unconferences (also known as &ldquo;open spaces&rdquo;, &ldquo;birds of a feather&rdquo;, etc) &mdash; but for those of you who are not, an unconference consists of unstructured sessions that are determined and hosted by you, the conference attendees. Expect deep discussions about challenging topics that may or may not fit the regular agenda -- and be prepared for a fun and stimulating experience you won't soon forget!</p>

<p>This is your opportunity to discuss ideas with Sencha experts from around the world! The unconference can be about anything and everything - so if you want to discuss responsive design, learn more about WebRTC or express your thoughts on CoffeeScript this is your time to shine!</p>

<p>Unconferences have been a part of thousands of events and are known to leave lasting impressions on conference attendees. Attendees often cite the unconference as the best part of the event, and with the strength and energy of our community, we are confident the SenchaCon Unconference will garner this sort of reaction as well.</p>

<p>Unconference sessions are <strong>all about conversation</strong>, and <i>anyone</i> attending the conference can propose a topic and lead a discussion. The goal for the SenchaCon &ldquo;unconference&rdquo; is to stimulate community discussion so that everyone has an opportunity to participate and have their ideas heard.</p>

<p><img src="http://cdn.sencha.io/img/20130424-unconference-3.jpg" alt="Unconference" width="318" class="rounded shadow alignright">Here&rsquo;s how it will work...</p>

<ol>
	<li>On Wednesday morning, we will remind you and everyone else about the unconference, and ask you to start thinking about potential topics.</li>
	<li>On Thursday morning we will post the unconference board so you can place your topics on the schedule.</li>
	<li>If you submit a topic, you will start the discussion; everyone else will simply show up and participate in the conversation.</li>
</ol>

<p>The SenchaCon &ldquo;unconference&rdquo; will consist of two 45-minute sessions on the second day (Thursday, July 18th) after lunch. There will be a break after both of the unconference sessions so that you have ample time to wrap up any conversations before moving to your next session.</p>

<p>That&rsquo;s it. Show up to the session you are interested in and have a conversation with fellow attendees. If you are not finding what you want, feel free to move to another conversation (this is the &ldquo;Law of Two Feet&rdquo;).</p>

<p>For more information please <a href="http://mindview.net/Conferences/OpenSpaces" target="_new">read</a> or <a href="http://www.youtube.com/watch?v=aD3S0wlbek0" target="_new">watch</a> Bruce Eckel&rsquo;s explanation of an &ldquo;unconference&rdquo;.</p>

<p>We look forward to seeing and hearing from you at SenchaCon 2013 in Orlando!</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Wed, 24 Apr 2013 14:41 GMT</pubDate>
        <guid>http://www.sencha.com/blog/the-unconference-unmasked/#date:14:41</guid>
        </item>
        
        <item>
        <title>Productive Enterprise Web Development with Ext JS and Clear Data Builder</title>
        <author>Viktor Gamov</author>
        <description>
            It&amp;rsquo;s not likely that you&amp;rsquo;ll start developing an enterprise HTML5 application without using one of the JavaScript frameworks. One of the most feature complete frameworks is Sencha Ext JS. Farata Systems has developed an open source software tool called Clear Toolkit for Ext JS. Clear Toolkit includes an Eclipse plugin called Clear Data Builder.
        </description>
        <link>http://www.sencha.com/blog/productive-enterprise-web-development-with-ext-js-and-clear-data-builder/</link>
        <content:encoded>
            <![CDATA[
                <p style="color:white; background-color:green; padding:5px;" class="rounded"><strong>Guest Blog Post</strong></p>

<p><img src="http://cdn.sencha.io/img/20130419-farata-systems/20130422-farata-systems.jpg" class="alignright rounded shadow" width="120">It&rsquo;s not likely that you&rsquo;ll start developing an enterprise HTML5 application without using one of the JavaScript frameworks. One of the most feature complete frameworks is Sencha Ext JS. <a href="http://www.faratasystems.com" target="_new">Farata Systems</a> has developed an open source software tool called Clear Toolkit for Ext JS. Clear Toolkit includes an Eclipse plugin called Clear Data Builder. This is a productivity tool &mdash; a code generator &mdash; that can create a CRUD application for you in no time. This application has an HTML/JavaScript/Ext JS client and Java-based server. In this article, you will learn how to jumpstart development of enterprise web applications.</p>

<h3>Part One: Ext JS MVC Application Scaffolding</h3>
<p>In Part One, I&rsquo;ll cover the following topics:</p>
<ul>
	<li>What is Clear Toolkit for Ext JS</li>
	<li>How to create an Ext JS MVC application for a Java-based project</li>
	<li>How to deploy and run your first Ext JS + Java application on Apache Tomcat server</li>
</ul>

<p>Clear Toolkit for Ext JS contains the following parts:</p>

<ul>
	<li><strong>Clear Data Builder (CDB)</strong> &mdash; Eclipse plugin that supports code generation of Ext JS MVC artifacts based on Java code. CDB comes with wizards to start a new project with plain Java or with popular frameworks like Hibernate, Spring, MyBatis.</li>
	<li><strong>Clear JS</strong> &mdash; a set of JavaScript components that extend Ext JS standard components. For example, Clear JS contains </li>ChangeObject &mdash; a universal way to trace the state changes between old and new versions of the same item in a store.
	<li><strong>Clear Runtime</strong> &mdash; Java components that implement the server side of ChangeObject, DirectOptions, etc.</li>
</ul>

<p>CDB helps you to be more productive which means you write less code and produce results faster. You&rsquo;ll see how CDB helps you to integrate the client side with the back-end using RPC style and how to implement data pagination for your application.</p>

<p>CDB distribution is available as a plugin for Eclipse IDE. You can download CDB <a href="http://cleartoolkit.com/downloads/plugins/extjs/cleardatabuilder/4.1.4/" target="_new">here</a>. The current version is 4.1.4. You can install this plugin via the Install New Software menu in the Eclipse IDE. Figure 1 shows how you can validate the plugin installation. If you see &ldquo;Clear Data Builder for Ext JS feature&rdquo; in the list of Installed Software in your Eclipse IDE, you&rsquo;re good to go.</p>

<p><i>Important: You must have &ldquo;Eclipse for Java EE Developers&rdquo; installed, which includes the plugins for automation of the Web applications.</i></p>

<a href="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-1.png" class="lightbox nth-1"><img src="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-1.png" alt="Farata Systems" width="636" class="rounded aligncenter"></a>

<p><b>Figure 1. Verifying CDB Installation</b></p>
<p>Clear Data Builder comes with a set of prepared examples that demonstrate the integration with popular Java frameworks &mdash; MyBatis, Hibernate, and Spring. Also, a plain Java project example that doesn&rsquo;t use any of the frameworks is available. Let&rsquo;s start with the creation of a new project by selecting the menu File &rarr; New &rarr; Other &rarr; Clear, and then press Next.</p>

<a href="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-2.png" class="lightbox nth-1"><img src="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-2.png" alt="Farata Systems" width="636" class="rounded aligncenter"></a>

<p><b>Figure 2. New CDB Project Wizard</b></p>
<p>First, let&rsquo;s call the new project episode_1_intro. CDB supports different ways of linking the Ext JS framework to the application. In my case, I have already installed Ext JS libraries under my Web server (Apache Tomcat). I&rsquo;m going to use this local Ext JS URL, but you can just specify any folder on your machine, and CDB will copy the Ext JS file inside your project. Lastly, you can use Ext JS from the <a href="http://cdn.sencha.io/ext-4.2.0-gpl/ext-all.js" target="_new">Sencha CDN</a>, if you don&rsquo;t want to store these libraries inside your project. Besides, using a common CDN will allow the Web browser to reuse the cached version of Ext JS.</p>

<p>For this project, we are not going to use any server side platform (like MyBatis or Hibernate). Just click the Finish button. First, CDB will print some initial messages on the Eclipse console. When CDB runs for the first time, it initializes a directory structure in the WebContent folder. Inside the WebContent directory, CDB creates a directory structure, which is recommended by Sencha for MVC applications. Also, you&rsquo;ll get the HTML wrapper &mdash; index.html &mdash; for this application, which contains the link to the entry point of our application.</p>

<p>CDB generates an empty project with one sample controller and one view &mdash; Viewport.js. To run this application, you need to add the newly generated Dynamic Web Project to Tomcat and start the server (right-click on the Tomcat in the Servers view of Eclipse).</p>

<a href="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-3.png" class="lightbox nth-1"><img src="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-3.png" alt="Farata Systems" width="636" class="rounded aligncenter"></a>

<p><b>Figure 3. Adding a Web Project to Tomcat</b></p>
<p>Let&rsquo;s switch to the web browser to open this application on http://localhost:8080/episode_1_intro . Voila! In just a couple of minutes, we&rsquo;ve set up a new Dynamic Web Project with the Ext JS framework support and one fancy button on the UI.</p>

<a href="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-4.png" class="lightbox nth-1"><img src="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-4.png" alt="Farata Systems" width="636" class="rounded aligncenter"></a>

<p><b>Figure 4. Running a Scaffolded Application</b></p>
<p>The next step is to make something useful out of this basic application.</p>

<h3>Part Two: Generating a CRUD Application</h3>
<p>CRUD stands for Create-Retrieve-Update-Delete. It&rsquo;s a well-known term for describing the applications that support data manipulation. The apps can retrieve data from some data source and update the data too. </p>

<p>In Part Two, I&rsquo;ll cover the following topics:</p>
<ul>
	<li>Create a simple CRUD Ext JS + Java application</li>
	<li>Create a POJO and the corresponding Ext.data.Model</li>
	<li>Create a Java service and populate Ext.data.Store with data from the service</li>
	<li>Use the auto-generated Ext JS application</li>
	<li>Extend the auto-generated CRUD methods</li>
	<li>Use ChangeObject</li>
</ul>

<p>Now, I would like to show you how to use CDB to create a CRUD application. I&rsquo;ll show you how you can turn your Java POJO class into the Ext JS model. I&rsquo;ll explain the following:</p>
<ul>
	<li>How you can populate the Ext JS store from a remote service</li>
	<li>How you can use automatically generated UI for that application</li>
	<li>How you can extend it</li>
	<li>How to use the ChangeObject class</li>
</ul>

<p>I will extend the application from Part 1. For my CRUD application, I need a Java POJO. First, I&rsquo;ve created the class Person.java in the package dto. Then I&rsquo;ve added the fieldsfirstName, lastName, address, ssn and phone and id. Also, I need getters and setters for these fields. It&rsquo;s good to have a constructor that uses these fields, and a DTO class should have a toString() method.</p>

<p>Now, I need the same corresponding Ext JS model for my Person. I just annotate this class with the CDB annotation called @JSClass to ask CDB to generate the Ext JS model.</p>

<p><b>Person Data Transfer Object</b></p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
	<span class="kw2">package</span> dto<span class="sy0">;</span>
&nbsp;
	<span class="kw2">import</span> com.<span class="me1">farata</span>.<span class="me1">dto2extjs</span>.<span class="me1">annotations</span>.<span class="me1">JSClass</span><span class="sy0">;</span>
	<span class="kw2">import</span> com.<span class="me1">farata</span>.<span class="me1">dto2extjs</span>.<span class="me1">annotations</span>.<span class="me1">JSGeneratedId</span><span class="sy0">;</span>
&nbsp;
	<span class="sy0">@</span>JSClass
	<span class="kw2">public</span> <span class="kw2">class</span> Person <span class="br0">&#123;</span>
&nbsp;
	<span class="sy0">@</span>JSGeneratedId
	<span class="kw2">private</span> Integer id<span class="sy0">;</span>
	<span class="kw2">private</span> String firstName<span class="sy0">;</span>
	<span class="kw2">private</span> String lastName<span class="sy0">;</span>
	<span class="kw2">private</span> String phone<span class="sy0">;</span>
	<span class="kw2">private</span> String ssn<span class="sy0">;</span>
&nbsp;
	<span class="kw2">public</span> Person<span class="br0">&#40;</span>Integer id<span class="sy0">,</span> String firstName<span class="sy0">,</span> String lastName<span class="sy0">,</span> String phone<span class="sy0">,</span>
	String ssn<span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="kw2">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="kw1">this</span>.<span class="me1">id</span> <span class="sy0">=</span> id<span class="sy0">;</span>
	<span class="kw1">this</span>.<span class="me1">firstName</span> <span class="sy0">=</span> firstName<span class="sy0">;</span>
	<span class="kw1">this</span>.<span class="me1">lastName</span> <span class="sy0">=</span> lastName<span class="sy0">;</span>
	<span class="kw1">this</span>.<span class="me1">phone</span> <span class="sy0">=</span> phone<span class="sy0">;</span>
	<span class="kw1">this</span>.<span class="me1">ssn</span> <span class="sy0">=</span> ssn<span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="co1">// Getters and Setter are omitted</span>
&nbsp;
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>Next, I need to annotate the id field with the CDB annotation @JSGeneratedId. With this annotation, I&rsquo;ll instruct CDB to treat this field as an auto-generated id. Let&rsquo;s examine the directory of the Ext JS MVC application and take a look inside the model folder. Inside the model folder (the JavaScript section), we have the folder dto which corresponds to the Java dto package where the class PersonModel.java resides.</p>

<a href="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-5.png" class="lightbox nth-1"><img src="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-5.png" alt="Farata Systems" width="636" class="rounded aligncenter"></a>

<p><b>Figure 5. Generated from Java Class Ext JS Model</b></p>
<p>As you can see Clear Data Builder generated two files as recommended by the <a href="http://martinfowler.com/dslCatalog/generationGap.html" target="_new">Generation Gap pattern</a>, which recommends keeping the generated and handwritten code separate by putting them in different classes, linked by inheritance. Let&rsquo;s open the Person model. In our case, the PersonModel.js is extended from the generated_PersonModel.js. In case we need to customize this class, we&rsquo;ll do it inside thePersonModel.js, but this underscore-prefixed file will be regenerated each and every time when we change something in our model. CDB follows this pattern for all generated artifacts &mdash; Java services, Ext JS models and stores. This model contains all the fields from our Person DTO.</p>

<p>Now, we need to create a Java service to populate the Ext JS store with the data. Let&rsquo;s create an interface PersonService in the package service. This service will return the list of persons. This interface contains one method -List&lt;Person&gt; getPersons().</p>

<p>I need to ask CDB to expose this service as a remote object, which is done by the annotation @JSService. Another annotation @JSGenetareStore will instruct CDB to generate the store. In this case, CDB will create the destination-aware store. This means that the store will know from what remote service to populate its content. All configurations of the store&rsquo;s proxies will be handled by the code generator. With @JSFillMethodannotation, we will identify our main read method (remember the &ldquo;R&rdquo; from CRUD).</p>

<p>Also, it would be nice to have some sort of UI to test the service &mdash; the annotation @JSGenerateSample will help here. CDB will examine the interface PersonService, and based on these annotations will generate all Ext JS MVC artifacts (models, views, controller) with the sample application.</p>

<p><b>PersonService Interface Annotated with CDB Annotations</b></p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
	<span class="sy0">@</span>JSService
	<span class="kw2">public</span> interface PersonService <span class="br0">&#123;</span>
	<span class="sy0">@</span>JSGenerateStore
	<span class="sy0">@</span>JSFillMethod
	<span class="sy0">@</span>JSGenerateSample
	List<span class="sy0">&lt;</span>Person<span class="sy0">&gt;</span> getPersons<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>When the code generation is complete, you&rsquo;ll get the implementation for the service &mdash; PersonServiceImpl. The store folder inside the application folder (WebContent\app) has the store, which is bound to the PersonModel. And my person model was generated previously. In this case, Clear Data Builder generated the store that binds to the remote service.</p>

<img src="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-6.png" alt="Farata Systems" class="rounded aligncenter">

<p><strong>Figure 6. Structure of Store and Model Folders</strong></p>
<p>All of this intermediate translation from the JavaScript to Java and from Java to JavaScript is done by <a href="https://code.google.com/p/directjngine/" target="_new">DirectJNgine</a>, which is a server side implementation of the <a href="http://www.sencha.com/products/extjs/extdirect" target="_new">Ext Direct</a> protocol. </p>

<p>There is one more thing you don&rsquo;t want to miss &mdash; Clear Data Builder generated a UI for us! Check out the samples directory shown in Figure 7.</p>

<img src="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-7.png" alt="Farata Systems" class="rounded aligncenter">

<p><strong>Figure 7. Folder with Generated Samples</strong></p>
<p>You can see the SampleController and SampleGridPanel inside the samples folder. CDB also generates the JavaScript application entry point &mdash; sampleApp.js. To test this application, just copy the file SampleController.js into the controller folder, SampleGridPanel.js into the view folder, and the sample application in the root of ourWebContent folder. You need to change the application entry point with sampleApp in index.html.</p>

<p>This is how the generated UI of the sample application looks:</p>

<a href="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-8.png" class="lightbox nth-1"><img src="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-8.png" alt="Farata Systems" width="636" class="rounded aligncenter"></a>

<p><strong>Figure 8. Scaffolded CRUD Application Template</strong></p>
<p>Let&rsquo;s return to the server side code. For services, CDB also follows the Generation Gap Pattern, and it generated stubs for the service methods. Override these methods when you&rsquo;re ready to implement the CRUD functionality.</p>

<p><strong>Implementation of PersonService Interface</strong></p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
	<span class="kw2">package</span> service<span class="sy0">;</span>
	<span class="kw2">import</span> java.<span class="me1">util</span>.<span class="me1">ArrayList</span><span class="sy0">;</span>
	<span class="kw2">import</span> java.<span class="me1">util</span>.<span class="me1">List</span><span class="sy0">;</span>
&nbsp;
	<span class="kw2">import</span> clear.<span class="me1">data</span>.<span class="me1">ChangeObject</span><span class="sy0">;</span>
	<span class="kw2">import</span> dto.<span class="me1">Person</span><span class="sy0">;</span>
	<span class="kw2">import</span> service.<span class="me1">generated</span>.<span class="sy0">*;</span>
&nbsp;
	<span class="kw2">public</span> <span class="kw2">class</span> PersonServiceImpl <span class="kw2">extends</span> _PersonServiceImpl <span class="br0">&#123;</span> <span class="co1">// 1</span>
&nbsp;
	<span class="sy0">@</span>Override
	<span class="kw2">public</span> List<span class="sy0">&lt;</span>Person<span class="sy0">&gt;</span> getPersons<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>				<span class="co1">// 2</span>
	List<span class="sy0">&lt;</span>Person<span class="sy0">&gt;</span> result <span class="sy0">=</span> <span class="kw2">new</span> ArrayList<span class="sy0">&lt;&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>	
	Integer id<span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span>
	result.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw2">new</span> Person<span class="br0">&#40;</span><span class="sy0">++</span>id<span class="sy0">,</span> <span class="st0">&quot;Joe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;Doe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;555-55-55&quot;</span><span class="sy0">,</span> <span class="st0">&quot;1111-11-1111&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	result.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw2">new</span> Person<span class="br0">&#40;</span><span class="sy0">++</span>id<span class="sy0">,</span> <span class="st0">&quot;Joe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;Doe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;555-55-55&quot;</span><span class="sy0">,</span> <span class="st0">&quot;1111-11-1111&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	result.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw2">new</span> Person<span class="br0">&#40;</span><span class="sy0">++</span>id<span class="sy0">,</span> <span class="st0">&quot;Joe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;Doe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;555-55-55&quot;</span><span class="sy0">,</span> <span class="st0">&quot;1111-11-1111&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	result.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw2">new</span> Person<span class="br0">&#40;</span><span class="sy0">++</span>id<span class="sy0">,</span> <span class="st0">&quot;Joe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;Doe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;555-55-55&quot;</span><span class="sy0">,</span> <span class="st0">&quot;1111-11-1111&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="kw1">return</span> result<span class="sy0">;</span>		<span class="co1">// 3</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="sy0">@</span>Override
<span class="kw2">public</span> <span class="kw1">void</span> getPersons_doCreate<span class="br0">&#40;</span>ChangeObject changeObject<span class="br0">&#41;</span> <span class="br0">&#123;</span>  <span class="co1">// 4</span>
Person dto <span class="sy0">=</span> <span class="br0">&#40;</span>Person<span class="br0">&#41;</span> deserializeObject<span class="br0">&#40;</span>
<span class="br0">&#40;</span>Map<span class="sy0">&lt;</span>String<span class="sy0">,</span> String<span class="sy0">&gt;</span><span class="br0">&#41;</span> changeObject.<span class="me1">getNewVersion</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span>
Person.<span class="kw2">class</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
System.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>dto.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="sy0">@</span>Override
<span class="kw2">public</span> <span class="kw1">void</span> getPersons_doUpdate<span class="br0">&#40;</span>ChangeObject changeObject<span class="br0">&#41;</span> <span class="br0">&#123;</span>	<span class="co1">// 5</span>
<span class="co1">// TODO Auto-generated method stub</span>
<span class="kw2">super</span>.<span class="me1">getPersons_doUpdate</span><span class="br0">&#40;</span>changeObject<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="sy0">@</span>Override
<span class="kw2">public</span> <span class="kw1">void</span> getPersons_doDelete<span class="br0">&#40;</span>ChangeObject changeObject<span class="br0">&#41;</span> <span class="br0">&#123;</span>	<span class="co1">// 6</span>
<span class="co1">// TODO Auto-generated method stub</span>
<span class="kw2">super</span>.<span class="me1">getPersons_doDelete</span><span class="br0">&#40;</span>changeObject<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="br0">&#125;</span>
&nbsp;</pre>

<ol>
	<li>We need to extend the generated class and provide the actual implementation.</li>
	<li>getPerson is our retrieve method (the R in CRUD).</li>
	<li>For this sample application, we can use java.util.ArrayList class as the in-memory server side storage of the Person objects. In real world applications, you&rsquo;d use a database or other persistent storage.</li>
	<li>fillmethod+doCreate() is our create method (the C in CRUD).</li>
	<li>fillmethod+doUpdate is our update method (the U in CRUD).</li>
	<li>fillmethod+doDelete is our delete method (the D in CRUD).</li>
</ol>

<p>Click on the Load menu, and you&rsquo;ll get 4 persons from our server.</p>

<p>To demonstrate the rest of the CRUD methods, we&rsquo;ll ask the user to insert one new row, modify three existing ones and remove two rows using the generated Web client. The Clear.data.DirectStore object will automatically create a collection of six ChangeObject&rsquo;s &mdash; one to represent a new row, three to represent the modified ones and two for the removed rows.</p>

<p>When the user clicks on the Sync menu, the changes will be sent to the corresponding do… remote method. When you sync(), a standard Ext.data.DirectStoreExtJS is POST-ing new, modified and deleted items to the server. When the request is complete, the server&rsquo;s reply data is applied to the store, expecting that some items can be modified by the server. In the case of Clear.data.DirectStore, instead of passing around items, we pass the delta, wrapped in the ChangeObject.</p>

<p>Each instance of the ChangeObject contains the following:</p>

<ol>
	<li><strong>newVersion</strong> &mdash; it&rsquo;s an instance of the newly inserted or modified item. On the Java side, it&rsquo;s available via getNewVersion().</li>
	<li><strong>prevVersion</strong> &mdash; it&rsquo;s an instance of the deleted old version of the modified item. On the Java side, it&rsquo;s available via getPrevVersion().</li>
	<li><strong>array of changepropertyNames</strong> &mdash;  this ChangeObject represents an update operation.</li>
</ol>

<p>The rest of ChangeObject details are described in the Clear Data Builder wiki on Github (see the Useful Links section below).</p>

<p>The corresponding Java implementation of ChangeObject is available on the server side, and Clear Toolkit passes ChangeObject instances to the appropriate do* method of the service class. Take a look at the getPersons_doCreate() method from the code sample above. When the server needs to read the data that arrived from the client, your Java class has to invoke the method changeObject.getNewVersion(). This method will return the JSON object that you need to deserialize into the object Person. This is done in the code sample above and looks like this:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
	Person dto <span class="sy0">=</span> <span class="br0">&#40;</span>Person<span class="br0">&#41;</span> deserializeObject<span class="br0">&#40;</span>
	<span class="br0">&#40;</span>Map<span class="sy0">&lt;</span>String<span class="sy0">,</span> String<span class="sy0">&gt;</span><span class="br0">&#41;</span> changeObject.<span class="me1">getNewVersion</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span>Person.<span class="kw2">class</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;</pre>

<p>When the new version of the Person object is extracted from the ChangeObject, you can do whatever has to be done to persist it in the appropriate storage. In our example, we just print the new person information on the server side Java console. This is why we said earlier, that it may be a good idea to provide a pretty printing feature on the class Person by overriding method toString(). Similarly, when you need to do a delete, the changeObject.getPrevVersion() would give you a person to be deleted.</p>

<h3>Part Three: Data Pagination</h3>
<p>The pagination feature is needed in almost every enterprise web application. Often, you don&rsquo;t want to bring all the data to the client at once &mdash; a page by page feed is a lot more responsive. The user can navigate back and forth between the pages using pagination UI components. To do that, we need to split our data on the server side into chunks, so we can display it when the specific page is required.</p> 

<p>In Part Three, I&rsquo;ll cover Implementing Pagination including:</p>
<ul>
	<li>Add the data pagination to our sample CRUD Ext JS + Java application:</li>
	<ul>
		<li>Add the Ext.toolbar.Paging component</li>
		<li>Bind both grid and pagingtoolbar to the same store</li>
		<li>Use DirectOptions class to read the pagination parameters</li>
	</ul>
</ul>

<p>We are going to extend our CRUD application by adding the paging toolbar component bound to the same store as the grid. The class DirectOptions will handle pagination parameters on the server side.</p>

<p>In Parts 1 and 2, you learned how to generate the UI from the Java back-end service and how to generate the Ext JS store and Ext JS model. In this part, you&rsquo;ll learn how to add the pagination functionality to your CRUD application by asking the server to send only portions of the data. We&rsquo;ll need to refactor the service code from the previous example to generate a little bit more data than the five records.</p>

<p><strong>Refactored implementation of PersonService Interface</strong></p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
	<span class="kw2">public</span> <span class="kw2">class</span> PersonServiceImpl <span class="kw2">extends</span> _PersonServiceImpl <span class="br0">&#123;</span>
	<span class="sy0">@</span>Override
	<span class="kw2">public</span> List<span class="sy0">&lt;</span>Person<span class="sy0">&gt;</span> getPersons<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	List<span class="sy0">&lt;</span>Person<span class="sy0">&gt;</span> result <span class="sy0">=</span> <span class="kw2">new</span> ArrayList<span class="sy0">&lt;&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="kw1">for</span> <span class="br0">&#40;</span>int i<span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span> i<span class="sy0">&lt;</span><span class="nu0">1000</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
	result.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw2">new</span> Person<span class="br0">&#40;</span>i<span class="sy0">,</span> <span class="st0">&quot;Joe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;Doe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;555-55-55&quot;</span><span class="sy0">,</span> <span class="st0">&quot;1111-11-1111&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
<span class="kw1">return</span> result<span class="sy0">;</span>
<span class="br0">&#125;</span>   
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>The Google Chrome Console shows that PersonStore was populated with one thousand records. Let&rsquo;s add the pagination component using the Ext toolbarpagingcomponent, and let&rsquo;s add it to the file sampleApp.js above.</p>

<p><strong>Sample Application Entry</strong></p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
	Ext.<span class="me1">Loader</span>.<span class="me1">setConfig</span><span class="br0">&#40;</span><span class="br0">&#123;</span>
	disableCaching <span class="sy0">:</span> <span class="kw2">false</span><span class="sy0">,</span>
	enabled <span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span>
	paths <span class="sy0">:</span> <span class="br0">&#123;</span>
	episode_3_pagination <span class="sy0">:</span> <span class="st0">'app'</span><span class="sy0">,</span>
	Clear <span class="sy0">:</span> <span class="st0">'clear'</span>
<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
Ext.<span class="me1">syncRequire</span><span class="br0">&#40;</span><span class="st0">'episode_3_pagination.init.InitDirect'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="co1">// Define GridPanel</span>
<span class="kw2">var</span> myStore <span class="sy0">=</span> Ext.<span class="me1">create</span><span class="br0">&#40;</span><span class="st0">'episode_3_pagination.store.dto.PersonStore'</span><span class="sy0">,</span><span class="br0">&#123;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>		<span class="co1">// 1</span>
Ext.<span class="me1">define</span><span class="br0">&#40;</span><span class="st0">'episode_3_pagination.view.SampleGridPanel'</span><span class="sy0">,</span> <span class="br0">&#123;</span>
extend <span class="sy0">:</span> <span class="st0">'Ext.grid.Panel'</span><span class="sy0">,</span>
store <span class="sy0">:</span> myStore<span class="sy0">,</span>
alias <span class="sy0">:</span> <span class="st0">'widget.samplegridpanel'</span><span class="sy0">,</span>
autoscroll <span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span>
plugins <span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
ptype <span class="sy0">:</span> <span class="st0">'cellediting'</span>
<span class="br0">&#125;</span><span class="br0">&#93;</span><span class="sy0">,</span>
dockedItems<span class="sy0">:</span> <span class="br0">&#91;</span>
<span class="br0">&#123;</span>
	xtype<span class="sy0">:</span> <span class="st0">'pagingtoolbar'</span><span class="sy0">,</span>		<span class="co1">// 2</span>
	displayInfo<span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span>
	dock<span class="sy0">:</span> <span class="st0">'top'</span><span class="sy0">,</span>
	store<span class="sy0">:</span> myStore			<span class="co1">// 3</span>
<span class="br0">&#125;</span>
<span class="br0">&#93;</span><span class="sy0">,</span>
columns <span class="sy0">:</span> <span class="br0">&#91;</span>
<span class="br0">&#123;</span>header <span class="sy0">:</span> <span class="st0">'firstName'</span><span class="sy0">,</span> dataIndex <span class="sy0">:</span> <span class="st0">'firstName'</span><span class="sy0">,</span> editor <span class="sy0">:</span> <span class="br0">&#123;</span>xtype <span class="sy0">:</span> <span class="st0">'textfield'</span><span class="br0">&#125;</span><span class="sy0">,</span> flex <span class="sy0">:</span> <span class="nu0">1</span> <span class="br0">&#125;</span><span class="sy0">,</span>
<span class="br0">&#123;</span>header <span class="sy0">:</span> <span class="st0">'id'</span><span class="sy0">,</span> dataIndex <span class="sy0">:</span> <span class="st0">'id'</span><span class="sy0">,</span> flex <span class="sy0">:</span> <span class="nu0">1</span> <span class="br0">&#125;</span><span class="sy0">,</span>
<span class="br0">&#123;</span>header <span class="sy0">:</span> <span class="st0">'lastName'</span><span class="sy0">,</span> dataIndex <span class="sy0">:</span> <span class="st0">'lastName'</span><span class="sy0">,</span> editor <span class="sy0">:</span> <span class="br0">&#123;</span>xtype <span class="sy0">:</span> <span class="st0">'textfield'</span><span class="br0">&#125;</span><span class="sy0">,</span> flex <span class="sy0">:</span> <span class="nu0">1</span> <span class="br0">&#125;</span><span class="sy0">,</span>
<span class="br0">&#123;</span>header <span class="sy0">:</span> <span class="st0">'phone'</span><span class="sy0">,</span> dataIndex <span class="sy0">:</span> <span class="st0">'phone'</span><span class="sy0">,</span> editor <span class="sy0">:</span> <span class="br0">&#123;</span>xtype <span class="sy0">:</span> <span class="st0">'textfield'</span><span class="br0">&#125;</span><span class="sy0">,</span> flex <span class="sy0">:</span> <span class="nu0">1</span> <span class="br0">&#125;</span><span class="sy0">,</span>
<span class="br0">&#123;</span>header <span class="sy0">:</span> <span class="st0">'ssn'</span><span class="sy0">,</span> dataIndex <span class="sy0">:</span> <span class="st0">'ssn'</span><span class="sy0">,</span> editor <span class="sy0">:</span> <span class="br0">&#123;</span>xtype <span class="sy0">:</span> <span class="st0">'textfield'</span><span class="br0">&#125;</span><span class="sy0">,</span> flex <span class="sy0">:</span> <span class="nu0">1</span> <span class="br0">&#125;</span><span class="br0">&#93;</span><span class="sy0">,</span>
tbar <span class="sy0">:</span> <span class="br0">&#91;</span>
<span class="br0">&#123;</span>text <span class="sy0">:</span> <span class="st0">'Load'</span><span class="sy0">,</span> action <span class="sy0">:</span> <span class="st0">'load'</span><span class="br0">&#125;</span><span class="sy0">,</span>
<span class="br0">&#123;</span>text <span class="sy0">:</span> <span class="st0">'Add'</span><span class="sy0">,</span> action <span class="sy0">:</span> <span class="st0">'add'</span><span class="br0">&#125;</span><span class="sy0">,</span>
<span class="br0">&#123;</span>text <span class="sy0">:</span> <span class="st0">'Remove'</span><span class="sy0">,</span> action <span class="sy0">:</span> <span class="st0">'remove'</span><span class="br0">&#125;</span><span class="sy0">,</span>
<span class="br0">&#123;</span>text <span class="sy0">:</span> <span class="st0">'Sync'</span><span class="sy0">,</span> action <span class="sy0">:</span> <span class="st0">'sync'</span><span class="br0">&#125;</span>
<span class="br0">&#93;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="co1">// Launch the application</span>
Ext.<span class="me1">application</span><span class="br0">&#40;</span><span class="br0">&#123;</span>
<span class="kw3">name</span> <span class="sy0">:</span> <span class="st0">'episode_3_pagination'</span><span class="sy0">,</span>
requires <span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">'Clear.override.ExtJSOverrider'</span><span class="br0">&#93;</span><span class="sy0">,</span>
controllers <span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">'SampleController'</span><span class="br0">&#93;</span><span class="sy0">,</span>
launch <span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
Ext.<span class="me1">create</span><span class="br0">&#40;</span><span class="st0">'Ext.container.Viewport'</span><span class="sy0">,</span> <span class="br0">&#123;</span>
items <span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
xtype <span class="sy0">:</span> <span class="st0">'samplegridpanel'</span>
<span class="br0">&#125;</span><span class="br0">&#93;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;</pre>

<ol>
	<li>Let&rsquo;s manually instantiate this store &mdash; create a separate variable myStore for this store with an empty config object.</li>
	<li>Add the xtype pagingtoolbar to this component docked items property &mdash; I&rsquo;d like to display the information and dock this element at the top.</li>
	<li>Now, the paging toolbar is also connected to same store.</li>
</ol>

<p>Next, we need to fix the automatically generated controller to control loading of data on the click of the Load button.</p>

<p><strong>Controller for Sample Application</strong></p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
	Ext.<span class="me1">define</span><span class="br0">&#40;</span><span class="st0">'episode_3_pagination.controller.SampleController'</span><span class="sy0">,</span> <span class="br0">&#123;</span>
	extend<span class="sy0">:</span> <span class="st0">'Ext.app.Controller'</span><span class="sy0">,</span>
	stores<span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">'episode_3_pagination.store.dto.PersonStore'</span><span class="br0">&#93;</span><span class="sy0">,</span>
	refs<span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>								<span class="co1">// 1</span>
	ref<span class="sy0">:</span> <span class="st0">'ThePanel'</span><span class="sy0">,</span>
	selector<span class="sy0">:</span> <span class="st0">'samplegridpanel'</span>
<span class="br0">&#125;</span><span class="br0">&#93;</span><span class="sy0">,</span>
&nbsp;
init<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
<span class="kw1">this</span>.<span class="me1">control</span><span class="br0">&#40;</span><span class="br0">&#123;</span>
<span class="st0">'samplegridpanel button[action=load]'</span><span class="sy0">:</span> <span class="br0">&#123;</span>
click<span class="sy0">:</span> <span class="kw1">this</span>.<span class="kw3">onLoad</span>
<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">,</span>
&nbsp;
<span class="kw3">onLoad</span><span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
<span class="co1">// returns instance of PersonStore</span>
<span class="kw2">var</span> store <span class="sy0">=</span> <span class="kw1">this</span>.<span class="me1">getThePanel</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getStore</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>		<span class="co1">// 2</span>
store.<span class="me1">load</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;</pre>

<ol>
	<li>We can bind the store instance to our grid panel. In the controller&rsquo;s refs property, I&rsquo;m referencing our simplegrid panel with ThePanel alias.</li>
	<li>In this case, I don&rsquo;t need to explicitly retrieve the store instance by name. Instead, we can use getters getPanel() and getStore() automatically generated by the Ext JS framework.</li>
</ol>

<p>When the user clicks the button next or previous, the method loadPage of the underlying store is called. Let&rsquo;s examine the directprovider URL &mdash; server side router of remoting calls &mdash; and see what the direct request looks like. Open Google Chrome Developer Tools from the menu, View &rarr; Developer, refresh the Web page and go to the Network tab. You&rsquo;ll see that each time the user clicks on the next or previous buttons on the pagination toolbar, the component sends directOptions as a part of the request.</p>

<a href="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-9.png" class="lightbox nth-1"><img src="http://cdn.sencha.io/img/20130419-farata-systems/farata-systems-9.png" alt="Farata Systems" width="636" class="rounded aligncenter"></a>

<p><strong>Figure 9. Request Payload Details</strong></p>
<p>The default Ext Direct request doesn&rsquo;t carry any information about page size. Clear JS, the client side extension of the Ext JS framework, adds some extra functionality to the Ext.data.DirectStore component to pass the page start and limit values to the server side. At this point, the directOptions request property shown in Figure 9 can be extracted on the server side to get the information about the page&rsquo;s boundaries. Let&rsquo;s return to the code of PersonServiceImpl and add some extra code there. Right now, the pagination doesn&rsquo;t work. The server sends the entire thousand records, because the server is not aware that the data has to be paginated. We&rsquo;ll fix it in the code below.</p>

<p><strong>Implementation of PersonService with Pagination</strong></p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
	<span class="kw2">package</span> service<span class="sy0">;</span>
	<span class="kw2">import</span> java.<span class="me1">util</span>.<span class="me1">ArrayList</span><span class="sy0">;</span>
	<span class="kw2">import</span> java.<span class="me1">util</span>.<span class="me1">List</span><span class="sy0">;</span>
&nbsp;
	<span class="kw2">import</span> clear.<span class="me1">djn</span>.<span class="me1">DirectOptions</span><span class="sy0">;</span>			<span class="co1">// 1</span>
&nbsp;
	<span class="kw2">import</span> dto.<span class="me1">Person</span><span class="sy0">;</span>
	<span class="kw2">import</span> service.<span class="me1">generated</span>.<span class="sy0">*;</span>
&nbsp;
	<span class="kw2">public</span> <span class="kw2">class</span> PersonServiceImpl <span class="kw2">extends</span> _PersonServiceImpl <span class="br0">&#123;</span>
	<span class="sy0">@</span>Override
	<span class="kw2">public</span> List<span class="sy0">&lt;</span>Person<span class="sy0">&gt;</span> getPersons<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	List<span class="sy0">&lt;</span>Person<span class="sy0">&gt;</span> result <span class="sy0">=</span> <span class="kw2">new</span> ArrayList<span class="sy0">&lt;&gt;;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="kw1">for</span> <span class="br0">&#40;</span>int i<span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span> i<span class="sy0">&lt;</span><span class="nu0">1000</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
	result.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw2">new</span> Person<span class="br0">&#40;</span>i<span class="sy0">,</span> <span class="st0">&quot;Joe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;Doe&quot;</span><span class="sy0">,</span> <span class="st0">&quot;555-55-55&quot;</span><span class="sy0">,</span> <span class="st0">&quot;1111-11-1111&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="co1">// 2</span>
int start <span class="sy0">=</span> <span class="br0">&#40;</span><span class="br0">&#40;</span>Double<span class="br0">&#41;</span>DirectOptions.<span class="me1">getOption</span><span class="br0">&#40;</span><span class="st0">&quot;start&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">intValue</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
int limit <span class="sy0">=</span> <span class="br0">&#40;</span><span class="br0">&#40;</span>Double<span class="br0">&#41;</span>DirectOptions.<span class="me1">getOption</span><span class="br0">&#40;</span><span class="st0">&quot;limit&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">intValue</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
limit <span class="sy0">=</span> Math.<span class="me1">min</span><span class="br0">&#40;</span>start<span class="sy0">+</span>limit<span class="sy0">,</span> result.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span>		<span class="co1">// 3</span>
DirectOptions.<span class="me1">setOption</span><span class="br0">&#40;</span><span class="st0">&quot;total&quot;</span><span class="sy0">,</span> result.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>	<span class="co1">// 4</span>
result <span class="sy0">=</span> result.<span class="me1">subList</span><span class="br0">&#40;</span>start<span class="sy0">,</span> limit<span class="br0">&#41;</span><span class="sy0">;</span>			<span class="co1">// 5</span>
&nbsp;
<span class="kw1">return</span> result<span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<ol>
	<li>On the server side, there is a special object called DirectOptions, which comes with Clear Toolkit.</li>
	<li>We&rsquo;re interested in start and in limit options (see Figure 9).</li>
	<li>Calculate the actual limit. Assign the size of the data collection to the limitvariable if it&rsquo;s less than the page size (start+limit).</li>
	<li>Notify the component about the total number of elements on the server side by using DirectOptions.setOption() method with total option.</li>
	<li>Before returning the result, create a subset, an actual page of data. In this case, we need to use the method java.util.List.sublist(), which produces the view of the portion of this list between indexes specified by the start and the limitparameters.</li>
</ol>

<li>As you can see from the Network tab in Figure 8, we limited the data load to 25 elements per page. Clicking on <i>next</i> or <i>previous</i> buttons will get you only a page worth of data. The Google Chrome Developers Tools Network tab shows that we are sending start and limit every time and our response contains an object with 25 elements.</li>

<p>If you&rsquo;d like to repeat all of the above steps on your own, watch <a href="http://faratasystems.com/training-at-farata-youtube-chanel/" target="_new">the screencasts</a> where I perform all the actions described in this article.</p>

The <a href="https://cleartoolkit.svn.sourceforge.net/svnroot/cleartoolkit/trunk/" target="_new">source code</a> is hosted on SourceForge as part of the <a href="https://sourceforge.net/projects/cleartoolkit/" target="_new">Clear Toolkit Project</a> under the <a href="http://www.opensource.org/licenses/mit-license.php" target="_new">MIT license</a>.

<h3>Conclusion</h3>
<p>The development of an enterprise web application involves many steps that need to be done by the developer. But with the right set of tools, the repetitive steps can be automated. Remember the DRY principle &mdash; don&rsquo;t repeat yourself. Try to do more with less effort.</p>

<h3>Additional Useful Links</h3>
<ul>
	<li><a href="http://farata.github.com/ClearJS/" target="_new">Clear Toolkit on Github</a></li>
	<li><a href="http://cleartoolkit.com/downloads/plugins/extjs/cleardatabuilder/4.1.4/" target="_new">Clear Data Builder Eclipse update site</a></li>
	<li><a href="http://docs.sencha.com/extjs/4.2.0/#!/guide/application_architecture" target="_new">Ext JS MVC Application Architecture</a></li>
	<li><a href="http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.Model" target="_new">Ext.data.Model</a></li>
	<li><a href="http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.Store" target="_new">Ext.data.Store</a></li>
	<li><a href="http://docs.sencha.com/extjs/4.2.0/#!/guide/grid" target="_new">Ext JS Grid Panel</a></li>
	<li><a href="http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.toolbar.Paging" target="_new">Ext.toolbar.Paging</a></li>
	<li><a href="http://www.sencha.com/products/extjs/extdirect" target="_new">Ext Direct</a></li>
	<li><a href="https://code.google.com/p/directjngine/" target="_new">DirectJNgine: Direct for Java</a></li>
	<li><a href="https://github.com/Farata/ClearJS/wiki/Change-Object%3A-Synchronization-Keystone" target="_new">Change Object: Synchronization Keystone</a></li>
	<li><a href="https://github.com/Farata/ClearJS/wiki/Data-Pagination" target="_new">Data Pagination in Clear Toolkit</a></li>
	<li><a href="http://youtube.com/trainingAtFarata" target="_new">Farata YouTube channel</a></li>
</ul> 
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Mon, 22 Apr 2013 14:59 GMT</pubDate>
        <guid>http://www.sencha.com/blog/productive-enterprise-web-development-with-ext-js-and-clear-data-builder/#date:14:59</guid>
        </item>
        
        <item>
        <title>Building apps integrated with Facebook using Sencha Touch</title>
        <author>Aditya Bansod</author>
        <description>
            A few months back, we demonstrated the power of HTML5 by building a responsive, high-performance Facebook client web app using Sencha Touch, called Fastbook (you can read about the making of this app here). We are happy to share the news that Sencha will be among one of the app development tool providers admitted to the new Facebook&amp;reg; Technology Partners program.
        </description>
        <link>http://www.sencha.com/blog/building-apps-integrated-with-facebook-using-sencha-touch/</link>
        <content:encoded>
            <![CDATA[
                <p><img src="http://cdn.sencha.io/img/20130417-facebook.jpg" alt="Build Sencha Touch apps with Facebook" width="170" class="rounded alignright shadow">A few months back, we demonstrated the power of HTML5 by building a responsive, high-performance Facebook client web app using Sencha Touch, called Fastbook (you can read about the making of this app <a href="http://www.sencha.com/blog/the-making-of-fastbook-an-html5-love-story/" target="_new">here</a>). We are happy to share the news that Sencha will be among one of the app development tool providers admitted to the new <a href="https://developers.facebook.com/docs/facebook-technology-partners/" target="_new">Facebook&reg; Technology Partners</a> program. From Facebook&rsquo;s <a href="https://developers.facebook.com/blog/post/2013/04/18/next-evolution-of-facebook-platform-for-mobile/" target="_new">announcement</a>:</p>
 
<blockquote class="pullquote" style="float:none; width:auto;">
	<p style="line-height:1.5em; font-size:23px;"><span>&ldquo;</span>The Facebook Technology Partners program connects developers to 3rd party resources that are built on top of Facebook Platform and SDKs to enable Facebook integration.<span style="font-size:4em; top:0.45em; position:relative; line-height:0; color: #e8e8e8;">&rdquo;</span></blockquote>
 
<p>Sencha Touch, our JavaScript framework that enables you to build high performance, touch-based web apps, allows you to easily integrate these apps into any back end, including Facebook. We&rsquo;ve built a sample application, called <a href="http://www.watchlistapp.com/" target="_new">The Watch List</a> that leverages a Node.js server, a MongoDB database (hosted by <a href="https://mongolab.com/" target="_new">MongoLab</a>), the Facebook Open Graph API, Login with Facebook and of course Sencha Touch. The client side Sencha Touch app authenticates the user with Login with Facebook and talks to the node.js server to make Facebook Open Graph API calls and to store what movies you&rsquo;re watching in MongoDB.</p>
 
<p>We&rsquo;ve recorded a code walkthrough that goes through the core pieces of The Watch List sample app, and shows how it implements Facebook integration both on the Sencha Touch client and on the node.js server side.</p>
 
<p style="text-align:center;"><object width="600" height="338"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=64262771&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=64262771&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="338"></embed></object></p>

<p>You can find the source code for the The Watch List on GitHub: <a href="https://github.com/senchalearn/Watchlist">https://github.com/senchalearn/Watchlist</a>.</p>
 
<p>To learn more about building your apps with Sencha Touch, don&rsquo;t miss SenchaCon 2013 July 16&ndash;19 in Orlando where Sencha engineers will present an entire track dedicated to Sencha Touch covering new features, advanced topics, insider tips and tricks. This is a great opportunity to meet 1:1 with Sencha engineers, meet other HTML5 and Sencha developers in the community, share best practices and network. We are also offering a pre-conference Sencha Touch Bootcamp where you will use Sencha Touch and Sencha Architect to create a working, enterprise mobile application in just one day. You can read more about this year&rsquo;s event at <a href="http://www.senchacon.com/?utm_source=website&utm_medium=blog-fb&utm_campaign=senchacon2013" target="_new">www.senchacon.com</a>.</p>
 
<p>If you&rsquo;re new to Sencha Touch, check out the documentation and get started building your first Sencha Touch app. When you&rsquo;re done, let us know and submit your app to the <a href="http://sencha.com/apps" target="_new">Sencha Touch app gallery</a>. Happy coding!</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Thu, 18 Apr 2013 15:30 GMT</pubDate>
        <guid>http://www.sencha.com/blog/building-apps-integrated-with-facebook-using-sencha-touch/#date:15:30</guid>
        </item>
        
        <item>
        <title>Introducing Ext JS 4.2</title>
        <author>Don Griffin</author>
        <description>
            Ext JS 4.2 contains many exciting enhancements and features. You may have read about some of these in previous posts, such as the improvements to the Grid component. In this article, we’ll take a tour of the new Neptune Theme and Right-to-Left (RTL) support.
        </description>
        <link>http://www.sencha.com/blog/introducing-ext-js-4-2/</link>
        <content:encoded>
            <![CDATA[
                <p><img src="http://cdn.sencha.io/img/extjs/20130311-ext-js-hero-1.png" class="rounded" width="636" alt="Ext JS 4.2"></p>

<p>Ext JS 4.2 contains many exciting enhancements and features. You may have read about some of these in previous posts, such as the improvements to the Grid component. In this article, we’ll take a tour of the new Neptune Theme and Right-to-Left (RTL) support.</p>

<h3>Neptune</h3>

<p>With Ext JS 4.2, we are excited to welcome &ldquo;Neptune&rdquo; to the family as an official, fully supported theme. Building applications that have a modern, contemporary look has always been incredibly important for application developers and with the new Neptune theme, Ext JS now supports four core themes out of the box: Neptune, Classic, Gray and Accessibility.</p>

<p><a href="http://cdn.sencha.io/img/20130411-extjs-4-2/extjs-4-2-neptune.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130411-extjs-4-2/extjs-4-2-neptune.png" class="rounded" width="636" alt="Sencha Ext JS Neptune Theme"></a></p>

<p>Neptune gives your application a clean, modern and lighter look by minimizing unnecessary visual elements such as borders and increased padding in many places to make the overall interface feel more relaxed and open.</p>

<p>Our goal for Neptune is far more than just providing a new and pretty face. We want to enable you to create the best application experience easily and on as many browsers as possible. To support this, we have made some significant advances in how we do theming that will make it easier to customize and share themes.</p>

<h4>Flexibility</h4>

<p>The key to creating the best applications is easy customization. Making changes has to be as simple as possible, because when it comes to themes: one size never fits all.</p>

<p>To make the Ext JS themes as flexible as possible, we’ve greatly expanded the use of Sass variables. The variables are chained together, so variables calculate their default values from other variables, and whenever possible, changes (such as setting the &ldquo;$base-color&rdquo;) propagate as you would expect.</p>

<h4>Theme Packages</h4>

<p>Sencha Cmd 3.1 adds support for &ldquo;packages&rdquo;: self-contained bundles of code, styling and resources. Neptune and the other Ext JS 4.2 themes are now delivered as theme Packages which enables many exciting possibilities.</p>

<p>In general, packages allow you to easily share code between your applications as well as with other developers. Sharing JavaScript classes is something that the Ext JS loader and previous versions of Sencha Cmd handled very well, but now, with packages, Sencha Cmd can connect the world of JavaScript classes to the world of Sass.</p>

<p>Internally, Ext JS leverages the Sencha Cmd ability to relate JavaScript and Sass to build its themes. That is, Cmd produces the &ldquo;all.scss&rdquo; and ultimately &ldquo;all.css&rdquo; that we ship with Ext JS. This build process ensures that the individual SCSS files defining Sass variables and rules are always in the right order based on the JavaScript class hierarchy. This allows us to share Sass logic between the various themes as easily as we do JavaScript classes.</p>

<p>Of course, these Sencha Cmd features are not limited to building Ext JS. If you use Cmd to build the &ldquo;all-classes.js&rdquo; file containing a concatenation and compression of all your JavaScript, you can extend this to build your application’s Sass. If you do, you gain another exciting first: your CSS file will contain only the CSS needed for the components you are actually using. This also works for views you define, so your application can organize its Sass as a mirror image of its JavaScript &mdash; a huge help as your application grows over time.</p>

<p>In the same way we improved user experience by not downloading lots of unused JavaScript, removing unused CSS can also be a big help. This is even more true of CSS because unnecessary rules are not so easily ignored by the browser. Some browsers also have limits on the number of rules you can have in your CSS file. Going forward, this will be increasingly important as new components are added and new features (like RTL) are added that span all components.</p>

<h4>Custom Themes</h4>

<p>Themes are special types of package that have one important, additional feature: themes can &ldquo;extend&rdquo; other themes. This capability is used by Ext JS 4.2 to create its theme hierarchy:</p>

<p><a href="http://cdn.sencha.io/img/20130411-extjs-4-2/extjs-4-2-tree.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130411-extjs-4-2/extjs-4-2-tree.png" class="rounded alignright" width="318" alt="Ext JS Theming Hierarchy"></a></p>

<p>The build process for theme packages has an extra step that allows a theme to inherit any of the resources of its base(s) or elect to replace them with a version of its own. Also, for IE compatibility, the image &ldquo;slicer&rdquo; is automatically invoked to transform your CSS3 border radius and linear gradient styles into background images.</p>

<p>All of this allows you to create new themes by adding only what you want to change (style rules, JavaScript code or static resources like images). There is no need to &ldquo;copy and paste&rdquo; anything from your base theme. This ensures that your themes will inherit bug fixes and other enhancements as we maintain the core themes.</p>

<p>You can learn a lot more about this process in the Theme Guide found <a href="http://docs.sencha.com/ext-js/4-2/#!/guide/theming" target="_new">here</a> and about packages in general in the package guides <a href="http://docs.sencha.com/ext-js/4-2/#!/guide/command_packages">http://docs.sencha.com/ext-js/4-2/#!/guide/command_packages</a> and <a href="http://docs.sencha.com/ext-js/4-2/#!/guide/command_package_authoring">http://docs.sencha.com/ext-js/4-2/#!/guide/command_package_authoring</a>.</p>

<h3>RTL</h3>

<p>The support for Right-to-Left languages (such as Hebrew and Arabic) has been a long-requested feature, so we are delighted to say that RTL is now here. We are equally happy to say that if you don’t need RTL support and do not enable it, there is only a minimal amount of additional code added to the core of the framework.</p>

<p>The first step to enabling RTL is to require the &ldquo;Ext.rtl.*&rdquo; namespace. This namespace contains many overrides that look like this:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
Ext.<span class="me1">define</span><span class="br0">&#40;</span>‘Ext.<span class="me1">rtl</span>.<span class="me1">button</span>.<span class="me1">Button</span>’<span class="sy0">,</span> <span class="br0">&#123;</span>
    override<span class="sy0">:</span> Ext.<span class="me1">button</span>.<span class="me1">Button</span>’<span class="sy0">,</span>
    …
&nbsp;</pre>

<p>This family of overrides takes over key positioning methods on various classes in the framework and adds the necessary RTL checks and logic.</p>

<p>The second step once you have the supporting code injected into the framework is to set the &ldquo;rtl&rdquo; config on the containers you want &mdash; such as the viewport:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
Ext.<span class="me1">define</span><span class="br0">&#40;</span>‘MyApp.<span class="me1">views</span>.<span class="me1">Viewport</span>’<span class="sy0">,</span> <span class="br0">&#123;</span>
    extend<span class="sy0">:</span> Ext.<span class="me1">container</span>.<span class="me1">Viewport</span>’<span class="sy0">,</span>
    requires<span class="sy0">:</span> <span class="br0">&#91;</span>
        ‘Ext.<span class="me1">rtl</span>.<span class="sy0">*</span>’
    <span class="br0">&#93;</span><span class="sy0">,</span>
    rtl<span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span>
    …
&nbsp;</pre>

<h4>RTL in Sass</h4>

<p>On the CSS side, RTL support is enabled by setting this Sass variable:</p>

<style><!-- GeSHi could not find the language {LANGUAGE} (using path {PATH}) --></style><pre class="sass">&nbsp;
$include-rtl: true;
&nbsp;</pre>

<p>This will add the CSS rules for RTL using the &ldquo;.x-rtl&rdquo; selector.</p>

<h4>Mixing LTR and RTL</h4>

<p>The &ldquo;rtl&rdquo; config is inherited down the Component hierarchy. By setting it on the Viewport, you are effectively setting RTL globally. This setting can be enabled at a lower level or changed back by setting &ldquo;rtl: false&rdquo; which is then inherited from that level down.</p>

<p>Due to CSS limitations in IE6 and IE/Quirks, nesting is not supported. Loading the CSS with RTL support must only be done when RTL is desired globally on these browsers.</p>

<h4>Locales</h4>

<p>To streamline this process for your applications, Sencha Cmd supports a package type of &ldquo;locale&rdquo;. Ext JS 4.2 now provides its locale support in this form, so your applications can simply require the appropriate locale package. The JavaScript needed will automatically be included and the include-rtl Sass variable set accordingly. Using this approach, you can produce an optimized JavaScript/CSS build for each locale.</p>

<h3>Performance</h3>

<p>This article would be incomplete if I did not say a few words about performance in Ext JS 4.2 compared to Ext JS 4.1 and 4.0. While the majority of performance improvement work has been in relation to grid, several other changes were made largely for performance reasons.</p>

<p>These changes ranged from removing the CSS reset (its numerous &ldquo;expensive&rdquo; rules to reset, scope reset and unreset), to moving logic out of JavaScript to handle &ldquo;framed&rdquo; components (such as buttons), to simplifying the button component markup and its corresponding component layout logic.</p>

<p>In the <a href="http://www.sencha.com/blog/whats-new-in-ext-js-4-1/" target="_new">previous article</a>, I compared Ext JS 4.0.7 to Ext JS 4.1 using the Themes example. Since then, a good friend in the community submitted an example application mimicking his own that is definitely a better, real-world test than Themes. I have put the probes to that example on the same IE8 / Windows 7 laptop and here are the results.</p>

<p><a href="http://cdn.sencha.io/img/20130411-extjs-4-2/extjs-4-2-bar-chart.jpg" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130411-extjs-4-2/extjs-4-2-bar-chart.jpg" class="rounded" width="636" alt="Ext JS Performance Bar Chart"></a></p>

<p>The breakdown of performance by category in Ext JS 4.2 now looks like the chart below. The numbers from previous versions are &ldquo;scratched out&rdquo; to show the progression from 4.0.7 to 4.1.1 to current 4.2.0.</p>

<p><a href="http://cdn.sencha.io/img/20130411-extjs-4-2/extjs-4-2-pie-chart.jpg" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130411-extjs-4-2/extjs-4-2-pie-chart.jpg" class="rounded" width="636" alt="Ext JS Performance Pie Chart"></a></p>

<p>Performance is never done, and we will continue to look for ways to increase performance. If you want to read more about all the work we did on Grid and the new bufferedrenderer plugin, check out the original blog post <a href="http://www.sencha.com/blog/first-look-at-ext-js-4-2-grid/" target="_new">here</a>.</p>

<h3>The Smaller Bits</h3>

<p>There are lots of little improvements here and there. For more details on these, consult the <a href="http://docs.sencha.com/ext-js/4-2/#!/guide/upgrade_42" target="_new">Upgrade Guide</a>.</p>

<h4>Grid/Tree</h4>

<p>There are several new examples that show how you can now combine many features which previously did not work together. Perhaps one of the most interesting is the <a href="http://docs.sencha.com/ext-js/4-2/#!/example/tree/locking-treegrid.html">locking TreeGrid</a>.</p>

<p>The bufferedrenderer plugin also works on trees so you can now handle much larger trees (or tree grids) than before. To see a locking, buffered rendered TreeGrid, check out <a href="http://docs.sencha.com/ext-js/4-2/#!/example/tree/locking-buffer-rendered-treegrid.html">the example</a>.</p>

<p>Check out <a href="http://docs.sencha.com/ext-js/4-2/#!/example" target="_new">all of the examples</a>.</p>

<h4>Tabs</h4>

<p>Tabs can now go vertical. You can see them rotated and docked on the left or right in the <a href="http://docs.sencha.com/ext-js/4-2/extjs-build/examples/tabs/side-tabs.html" target="_new">new Side Tabs example</a></a></p>

<h4>Glyphs</h4>

<p>Many folks want to use web fonts to add scalable, cross-browser images to their application. To support this, we have added the &ldquo;glyph&rdquo; config which is very similar to &ldquo;icon&rdquo; and &ldquo;iconCls&rdquo;. You just set the &ldquo;glyph&rdquo; config to be the code point and the necessary text will be rendered into the component:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="br0">&#123;</span>
    xtype<span class="sy0">:</span> <span class="st0">'button'</span><span class="sy0">,</span>
    glyph<span class="sy0">:</span> <span class="nu0">42</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>This is supported for buttons, tabs, panel headers and menu items. You can see this in action in the <a href="http://docs.sencha.com/ext-js/4-2/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#basic-panels" target="_new">new Kitchen Sink example</a>.</p>

<h4>MVC</h4>

<p>The introduction of Event Domains allows your Controller to respond to events fired by things like Stores or other Controllers.</p>

<p>Here’s what the code looks like:</p>
<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="kw1">this</span>.<span class="me1">listen</span><span class="br0">&#40;</span><span class="br0">&#123;</span>
    controller<span class="sy0">:</span> <span class="br0">&#123;</span>
        <span class="st0">'*'</span><span class="sy0">:</span> <span class="br0">&#123;</span>  <span class="co1">// any controller</span>
            foo<span class="sy0">:</span> <span class="st0">'onFoo'</span> <span class="co1">// method names are now supported!</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#125;</span><span class="sy0">,</span>
    store<span class="sy0">:</span> <span class="br0">&#123;</span>
        <span class="st0">'#storeId'</span><span class="sy0">:</span> <span class="br0">&#123;</span>
            remove<span class="sy0">:</span> ‘onStoreRemove’
        <span class="br0">&#125;</span>
    <span class="br0">&#125;</span><span class="sy0">,</span>
    component<span class="sy0">:</span> <span class="br0">&#123;</span> <span class="co1">// same as this.control()</span>
    <span class="br0">&#125;</span>
&nbsp;
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;</pre>
<h4>XTemplate</h4>

<p>You can now iterate objects more easily in your templates:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.xml .imp {font-weight: bold; color: red;}
.xml .es0 {color: #000099; font-weight: bold;}
.xml .br0 {color: #66cc66;}
.xml .sy0 {color: #66cc66;}
.xml .st0 {color: #ff0000;}
.xml .sc-1 {color: #808080; font-style: italic;}
.xml .sc0 {color: #00bbdd;}
.xml .sc1 {color: #ddbb00;}
.xml .sc2 {color: #339933;}
.xml .sc3 {color: #009900;}
.xml .re0 {color: #000066;}
.xml .re1 {color: #000000; font-weight: bold;}
.xml .re2 {color: #000000; font-weight: bold;}
.xml span.xtra { display:block; }
</style><pre class="xml">&nbsp;
<span class="sc3"><span class="re1">&lt;tpl</span> <span class="re0">foreach</span>=<span class="st0">&quot;.&quot;</span><span class="re2">&gt;</span></span>
    <span class="sc3"><span class="re1">&lt;tr<span class="re2">&gt;</span></span></span>
        <span class="sc3"><span class="re1">&lt;td<span class="re2">&gt;</span></span></span>{$}<span class="sc3"><span class="re1">&lt;/td<span class="re2">&gt;</span></span></span>
        <span class="sc3"><span class="re1">&lt;td<span class="re2">&gt;</span></span></span>{.}<span class="sc3"><span class="re1">&lt;/td<span class="re2">&gt;</span></span></span>
    <span class="sc3"><span class="re1">&lt;/tr<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/tpl<span class="re2">&gt;</span></span></span>
&nbsp;</pre>

<p>The &ldquo;&#123;$&#125;&rdquo; expands as the property name and &ldquo;&#123;.&#125;&rdquo; is the property value.</p>

<h3>Conclusion</h3>

<p>Creating compelling, modern applications is hard work. Making them look awesome, run fast, and be delightful to use is even harder. With Neptune, RTL, the new grid improvements, enhancements to Cmd and all the various new features in Ext JS 4.2, delivering amazing experiences to your users has never been easier!</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Wed, 17 Apr 2013 14:00 GMT</pubDate>
        <guid>http://www.sencha.com/blog/introducing-ext-js-4-2/#date:14:00</guid>
        </item>
        
        <item>
        <title>Hello Sencha Touch 2.2</title>
        <author>Aditya Bansod</author>
        <description>
            We&amp;rsquo;re excited to announce the general availability of Sencha Touch 2.2, the latest version of our JavaScript framework for building multi-device, touch-based applications. We&amp;rsquo;ve been hard at work on the latest version of Touch, adding in a whole host of new features as well as fixing issues and bugs (thank you to all our beta testers!)
        </description>
        <link>http://www.sencha.com/blog/hello-sencha-touch-2-2/</link>
        <content:encoded>
            <![CDATA[
                <p><a href="/products/touch/download/"><img src="http://cdn.sencha.io/img/20130410-touch-2-2/touch-2-2-hero-download.png" alt="Sencha Touch 2.2" width="636" class="rounded"></a></p>

<p>We&rsquo;re excited to announce the general availability of Sencha Touch 2.2, the latest version of our JavaScript framework for building multi-device, touch-based applications. We&rsquo;ve been hard at work on the latest version of Touch, adding in a whole host of new features as well as fixing issues and bugs (thank you to all our beta testers!).</p>  

<p>Our focus for Sencha Touch 2.2 was to expand the footprint of device support to give you, our community, the broadest selection of devices to run your apps. In this release, we&rsquo;ve enhanced our support for BlackBerry 10 devices and added support for Internet Explorer 10 for Windows 8 and Windows Phone 8. We&rsquo;ve also made some big changes to improve performance in lists, themes, new debugging capabilities, added the new AnimationQueue feature, and more. This is the best Sencha Touch yet.</p>

<h3>Updated BlackBerry 10 support</h3>
<p><a href="http://cdn.sencha.io/img/20130410-touch-2-2/blackberry.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130410-touch-2-2/blackberry.png" width="500" class="aligncenter"></a></p>
<p>Sencha Touch already runs great on the recently released BlackBerry Z10 and also runs great on the forthcoming BlackBerry Q10. For Touch 2.2, we partnered closely with the folks at BlackBerry to take it even a notch higher, and now your Touch apps have everything they need to run lightning fast on BlackBerry 10 devices. You&rsquo;ll find that the right markup, the right styling, and the right parameters for things like touch handling are all in place.</p>

<h3>New Internet Explorer 10 Support</h3>
<p><a href="http://cdn.sencha.io/img/20130410-touch-2-2/wp8.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130410-touch-2-2/wp8.png" width="200" class="alignright"></a>
Sencha Touch 2.2 is the first version that works on Microsoft&rsquo;s Internet Explorer 10 browser &mdash; goodbye WebKit dependencies! For the past few months, we worked with the Microsoft Open Tech team to remove all the WebKit specific code in Sencha Touch (or only use it when we&rsquo;re on a WebKit browser). Under the hood, we&rsquo;re using standard CSS3 flexible box layouts and HTML5 DOM selectors to get all of our layouts and rendering working beautifully wherever IE 10 runs (such as the Surface, Windows Phone 8, and Windows 8 devices).</p>

<p>We also built a new Windows 8 style modern theme that developers can use to build Microsoft-style looking applications just by switching to the new theme. It features the high padding, no-gradient, sans serif style that&rsquo;s perfect for building Windows 8 and Windows Phone 8 applications. It&rsquo;s pretty eye-catching, definitely check it out.</p>

<h3>New Theming System</h3>

<p style="text-align:center;"><object width="600" height="338"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=63783807&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=63783807&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="338"></embed></object></p>

<p>To make all the new platforms and new themes easy to support, Sencha Touch 2.2 features a revamped theming system. Switching your applications theme is as simple as changing the css property in your app.json file and the microloader and framework handle the rest. Our Kitchen Sink example now uses this system to display different themes based on which device it is being used on. You can see its app.json configuration here:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="st0">&quot;css&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span>
    <span class="br0">&#123;</span>        <span class="br0">&#123;</span>
        <span class="st0">&quot;path&quot;</span><span class="sy0">:</span> <span class="st0">&quot;resources/css/sencha-touch.css&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;platform&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">&quot;chrome&quot;</span><span class="sy0">,</span> <span class="st0">&quot;safari&quot;</span><span class="sy0">,</span> <span class="st0">&quot;ios&quot;</span><span class="sy0">,</span> <span class="st0">&quot;android&quot;</span><span class="sy0">,</span> <span class="st0">&quot;firefox&quot;</span><span class="br0">&#93;</span><span class="sy0">,</span>
        <span class="st0">&quot;theme&quot;</span><span class="sy0">:</span> <span class="st0">&quot;Default&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;update&quot;</span><span class="sy0">:</span> <span class="st0">&quot;delta&quot;</span>
    <span class="br0">&#125;</span><span class="sy0">,</span>
    <span class="br0">&#123;</span>
        <span class="st0">&quot;path&quot;</span><span class="sy0">:</span> <span class="st0">&quot;resources/css/wp.css&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;platform&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">&quot;ie10&quot;</span><span class="br0">&#93;</span><span class="sy0">,</span>
        <span class="st0">&quot;theme&quot;</span><span class="sy0">:</span> <span class="st0">&quot;Windows&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;update&quot;</span><span class="sy0">:</span> <span class="st0">&quot;delta&quot;</span>
    <span class="br0">&#125;</span><span class="sy0">,</span>
    <span class="br0">&#123;</span>
        <span class="st0">&quot;path&quot;</span><span class="sy0">:</span> <span class="st0">&quot;resources/css/bb10.css&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;platform&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span><span class="st0">&quot;blackberry&quot;</span><span class="br0">&#93;</span><span class="sy0">,</span>
        <span class="st0">&quot;theme&quot;</span><span class="sy0">:</span> <span class="st0">&quot;Blackberry&quot;</span><span class="sy0">,</span>
        <span class="st0">&quot;update&quot;</span><span class="sy0">:</span> <span class="st0">&quot;delta&quot;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#93;</span><span class="sy0">,</span>
&nbsp;</pre>

<p>We encourage you to try out the various built-in themes by using the “Theme” option in our Kitchen Sink demo app. Also <a href="http://docs.sencha.com/touch/2-2/#!/guide/theming" target="_new">check out our theming guide</a>.</p>

<p>In Touch 2.2, we&rsquo;ve changed the icons to use font-face &mdash; which are supported across all modern browsers, are more compact, and scale beautifully. Just like Sencha Touch 1 and 2.1, we conveniently map icon names to actual icons so you can use them within your application. For example:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="br0">&#123;</span>
    xtype<span class="sy0">:</span> <span class="st0">'button'</span><span class="sy0">,</span>
    iconCls<span class="sy0">:</span> <span class="st0">'home'</span><span class="sy0">,</span>
    title<span class="sy0">:</span> <span class="st0">'Home'</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<p>For a full list of available iconCls's available, please refer to the <a href="http://docs.sencha.com/touch/2-2/#!/api/Ext.Button" target="_new">Ext.Button class documentation</a>.</p>

<h3>Performance Improvements</h3>

<p><a href="http://cdn.sencha.io/img/20130410-touch-2-2/fps.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130410-touch-2-2/fps.png" width="175" class="alignright"></a>In December, we demonstrated the power and speed of HTML5 with our <a href="http://www.sencha.com/blog/the-making-of-fastbook-an-html5-love-story/" target="_new">Fastbook proof of concept application</a>. We&rsquo;re excited to announce that many of the techniques we pioneered in Fastbook are now built into Sencha Touch 2.2. Specifically,</p>
<ul>
<li>AnimationQueue is a centralized Event and Animation queue. When the browser has requestAnimationFrame, AnimationQueue uses that HTML5 API, and when it&rsquo;s not, uses more vanilla JavaScript timers. This new system helps ensure that we handle animations and other events only in between frames, so everything runs smoothly.</li>

<li>List DOM has been dramatically streamlined. Almost all Touch apps use a list and with the lighter DOM, scrolling will remain fast even as your list and templates get more complicated.</li>

<li>The showfps debugging option lets developers see how fast Touch is rendering and will help you see when your application&rsquo;s design is outpacing the performance of the device.</li>
</ul>

<h3>Sencha Architect 2.2 Support</h3>

<p>Today we also released an update to Sencha Architect 2.2 that includes support for Sencha Touch 2.2, thus instantly allowing our Architect users to become Touch 2.2 developers. Architect can help build your next great Touch app, and if you have an existing Architect+Touch project, you can easily upgrade it to a Sencha Touch 2.2 project. Architect makes it easy to switch between the new built-in Touch themes.</p>

<h3>Try It Out</h3>

<p>Go ahead and take Sencha Touch 2.2 for a spin: try the <a href="http://www.sencha.com/products/touch-bundle">Sencha Touch Bundle</a>, which includes Sencha Touch, Sencha Touch Charts, Sencha Eclipse Plugin, and Sencha Architect; or download the free standalone <a href="http://www.sencha.com/products/touch/">Sencha Touch SDK</a>. It&rsquo;s available with a 30-day trial, so feel free to download it and give it a go: it gives you everything you need if you are serious about building great touch apps.  </p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Mon, 15 Apr 2013 14:38 GMT</pubDate>
        <guid>http://www.sencha.com/blog/hello-sencha-touch-2-2/#date:14:38</guid>
        </item>
        
        <item>
        <title>SenchaCon Update: Early Bird Extended, and More</title>
        <author>Tracy Pullman</author>
        <description>
            Wanted to share some great news and a few conference updates. First the good news &amp;mdash; we are extending early bird pricing an extra two weeks. We heard the pleas for &amp;ldquo;just a bit more time&amp;rdquo; from many who were scrambling to work out schedules, get approvals, finish their taxes, etc... and we obliged.
        </description>
        <link>http://www.sencha.com/blog/senchacon-update-early-bird-extended-and-more/</link>
        <content:encoded>
            <![CDATA[
                <p><a href="http://www.senchacon.com/?utm_source=website&utm_medium=blog-ebext&utm_campaign=senchacon2013" target="_new"><img src="http://cdn.sencha.io/img/home/promos/promos-20130401-senchacon-earlybird-extended.png" class="alignright rounded" width="208"></a>Wanted to share some great news and a few conference updates. First the good news &mdash; we are extending early bird pricing an extra two weeks. We heard the pleas for &ldquo;just a bit more time&rdquo; from many who were scrambling to work out schedules, get approvals, finish their taxes, etc... and we obliged. You now have until April 21st at midnight Pacific time to get the $1095 price, but that is a firm deadline. No more excuses, no more extensions, after that the price steps up to $1295.</p>

<p>Meanwhile, we have been working hard to truly make <a href="http://www.senchacon.com/?utm_source=website&utm_medium=blog-ebext&utm_campaign=senchacon2013" target="_new">SenchaCon 2013</a> bigger, better and more fun than ever. The big focus from our technical team right now is getting the first set of technical sessions ready to post on the website. Within a week, we should have a little more than half of the 60+ sessions available to peruse (spoiler alert: it&rsquo;ll probably actually be more than 70 when all is said and done). </p>

<p>For those of you that submitted a session proposal to our call for papers and are awaiting a response before you register, we will be notifying everyone by end of next week. If you want to register now and take advantage of the early bird price, you can go ahead &mdash; if you get accepted as a speaker, we will simply refund your ticket cost.</p>

<p>We&rsquo;ve also had better than expected response to our &ldquo;build your vacation around SenchaCon&rdquo; concept. Seems lots of you are taking advantage of the discounted room rates and booking some of the &ldquo;shoulder days&rdquo; (the few days prior or few days after the event) to enjoy Florida. Although we still have plenty of hotel rooms available overall, rooms at the conference rate on shoulder days are limited, so if you&rsquo;re thinking about staying an extra long time <a href="https://www.senchacon.com/registration/fp?client_id=SENCHA&event_id=SENCHACON%202013&utm_source=website&utm_medium=blog-ebext&utm_campaign=senchacon2013" target="_new">make sure you book sooner rather than later</a>.</p>

<p>
<a href="http://cdn.sencha.io/img/20130410-senchacon-earlybird-extended/senchacon-1.jpg" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130410-senchacon-earlybird-extended/senchacon-1.jpg" alt="SenchaCon Swan &amp; Dolphin" class="alignleft rounded" width="636"></a>
<a href="http://cdn.sencha.io/img/20130410-senchacon-earlybird-extended/senchacon-2.jpg" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130410-senchacon-earlybird-extended/senchacon-2.jpg" alt="SenchaCon Swan &amp; Dolphin" class="alignleft rounded" width="636"></a>
<a href="http://cdn.sencha.io/img/20130410-senchacon-earlybird-extended/senchacon-3.jpg" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130410-senchacon-earlybird-extended/senchacon-3.jpg" alt="SenchaCon Swan &amp; Dolphin" class="alignleft rounded" width="636"></a>
</p>

<p>Never been to SenchaCon? Check out this montage video we pulled together to see how this community rolls. If you were there with us in Austin, see if you can spot yourself. Either way, this should get you pumped up for Orlando in July!</p>

<p style="text-align:center;"><object width="600" height="338"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=63754180&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=63754180&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="338"></embed></object></p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Wed, 10 Apr 2013 18:31 GMT</pubDate>
        <guid>http://www.sencha.com/blog/senchacon-update-early-bird-extended-and-more/#date:18:31</guid>
        </item>
        
        <item>
        <title>Sencha Ext JS Spotlight: KiteDesk</title>
        <author>Jack Kennedy</author>
        <description>
            KiteDesk funnels your most important cloud information into a single data stream. You can view emails, social media posts, calendar items, contact info, docs, pictures and videos in one place - no more "app-flipping." Read about how KiteDesk used Sencha Ext JS to build this very sophisticated HTML5 application with minimal startup time.
        </description>
        <link>http://www.sencha.com/blog/ext-js-spotlight-kitedesk/</link>
        <content:encoded>
            <![CDATA[
                <figure>
<img src="http://cdn.sencha.io/img/20130317-kite-desk/kite-desk-hero.png" alt="KiteDesk hero" width="636" class="aligncenter">
<figcaption style="text-align:center;"><p>KiteDesk uses Ext JS to deliver a native application look and feel in an HTML5 based web app.</p></figcaption>
</figure>

<p><img src="http://cdn.sencha.io/img/20130317-kite-desk/kite-desk-logo.jpg" alt="KiteDesk hero" width="150" class="alignright"> <a href="http://www.kitedesk.com" target="_new">KiteDesk</a> funnels your most important cloud information into a single data stream. The idea is simple: consumers use Dropbox, Facebook, Gmail, Twitter, LinkedIn, etc., but switching between apps is a pain. KiteDesk brings them all together, so users can view emails, social media posts, calendar items, contact info, docs, pictures and videos in one place &mdash; no more "app-flipping." Users can also build custom streams, for things like work, book clubs and softball leagues.</p>

<figure>
	<a href="http://cdn.sencha.io/img/20130317-kite-desk/kite-desk-1.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-kite-desk/kite-desk-1.png" alt="KiteDesk" width="636" class="rounded shadow aligncenter"></a>
	<figcaption style="text-align:center;"><p>KiteDesk&rsquo;s Stream Viewer integrates content from social and mail accounts in one view.</p></figcaption>
</figure>

<h3>Why We Chose Sencha Ext JS</h3>
<p>We selected Ext JS because it offers a very complete and robust client-side framework with beautiful built-in controls, and a simple but powerful programming model. We needed to enable a team of experienced Java developers to deliver a very sophisticated HTML5 based application with minimal startup time. Ext JS does a wonderful job of promoting a model, view, controller (MVC) architecture which is very familiar to programmers from a number of backgrounds. We designed KiteDesk&rsquo;s user experience to feel like an app, and that required the latest web standards and capabilities like offline storage. Ext JS made it easy to load information from our existing REST services, store it, and to link it to our user interface controls using a convention over configuration approach.</p>

<figure>
	<a href="http://cdn.sencha.io/img/20130317-kite-desk/kite-desk-2.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-kite-desk/kite-desk-2.png" alt="KiteDesk" width="636" class="rounded shadow aligncenter"></a>
	<figcaption style="text-align:center;"><p>KiteDesk makes heavy use of many Ext JS built-in components like Panels, GridPanels, Windows, Buttons and Stores.</p></figcaption>
</figure>

<p>The screenshot above shows KiteDesk&rsquo;s Messages. The left column uses a subclass of the Ext JS Grid Panel to list email accounts and folders. The Grid Panel ties an interactive view with an underlying data store, in this case the mail accounts and folders. As accounts are added or updated with new messages, the list is automatically updated to match. Here we display accounts as icons, each with its own tooltip describing it in more detail.</p>

<p>The middle column lists mail messages for an account, and it also uses a Grid Panel filtering messages on the account and label selected in the navigation.</p>

<p>KiteDesk makes heavy use of many Ext JS built-in components like Panels, GridPanels, Windows, Buttons, Stores, etc. We also created a number of application-specific components to give the app its unique look and feel. In the Messages mail client, for example, we wanted to display messages using a distinctive and interactive card-like format. Since a user checking their inbox will be viewing one message thread after another, we wanted those cards to be as lightweight as possible and for the user experience to be fast and responsive. 

<blockquote class="pullquote"><p><span>&ldquo;</span>We selected Ext JS because it offers a very complete and robust client-side framework with beautiful built-in controls, and a simple but powerful programming model.</p>
</blockquote>

Our custom MessageCard component is based on the Ext JS Container component and includes a header, body and footer, each of which is pure generated HTML that can be updated independently of the others. Using HTML keeps our component lightweight, so it's quick to draw, update, and tear down. A single click handler determines which part of the card was clicked on and fires the appropriate event to trigger a reply, forward, mark unread, etc. Following MVC conventions, those events are then handled by the appropriate controller.</p>

<p>Our early versions of MessageCard were built using standard Ext JS buttons and other components, which made it easy to rapidly prototype and try out different approaches and layouts. Once we settled on the best one, we then customized the component to generate hand-crafted HTML and minimize the JavaScript objects needed for each card to further improve performance.</p>

<p>The Ext JS documentation is top notch, and it was easy for our team to learn quickly and get the most out of the framework. We were pleased to discover that the online version of the doc includes user comments which we were very helpful. And, of course, the Sencha Forums were incredibly valuable and useful as well.</p>

<p>All in all, Ext JS is a solid and mature framework, and one we trust to build our product on. We have also found the Sencha community to be friendly and knowledgeable, which helped us tremendously.</p>

<p>We make extensive use of the powerful Event support Ext JS provides to seamlessly wire our application. For example, clicking the star icon on a message adds that message to your favorites. Behind the scenes that click fires a starMessage event which is handled by the MailController which takes care of the logic behind that action. That event could also be triggered by choosing the &ldquo;Star Message&rdquo; menu item, or by whatever other method you wish, but regardless of its source the event is captured and handled by the MailController. This is just one example of how Ext JS makes it easy to leverage MVC architecture, which cleanly separates the view (that users see and interact with) from the underlying controller logic.</p>

<figure>
	<a href="http://cdn.sencha.io/img/20130317-kite-desk/kite-desk-3.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-kite-desk/kite-desk-3.png" alt="KiteDesk" width="636" class="rounded shadow aligncenter"></a>
	<figcaption style="text-align:center;"><p>KiteDesk users can create and manage events across different calendars. Using the standard Ext JS controls, it was easy for us to create data bound forms with sophisticated controls.</p></figcaption>
</figure>

<h3>Business Value of Using Sencha Ext JS</h3>
<p>Ext JS offers an environment that is completely extensible and does not box developers into corners. It&rsquo;s a core part of our product strategy because it allowed us to migrate our team of Java developers to an HTML5 based project faster and more efficiently. We got our team up to speed quickly using the extensive, high quality documentation. We didn&rsquo;t face challenges of having to use disparate 3rd party controls and competing core programming models. Our initial prototype was delivered in much less time than it would have been using other JavaScript frameworks, and we were able to create a clean and modern UI. By using Ext JS, we were able to get our initial product to beta sooner which allowed us to get user feedback early in the cycle saving us time and money beyond the pure productivity gains offered by the framework.</p>

<h3>Our Advice to New Developers</h3>
<p>Ext JS will make it easy to develop your applications. It&rsquo;s tempting to jump in and start writing your application immediately because the framework is so approachable. We recommend that you spend some time up front reviewing the examples and the documentation. Take advantage of the MVC convention that is built into Ext JS because it will minimize the code you write. If you find yourself writing a lot of code, it&rsquo;s likely that you have missed some of the core capabilities and best practices of the framework. The event handling, CSS compilation, and other features of the framework should be invested in and understood at the onset of your project because using these capabilities will save you a huge amount of time over the long run.</p>

<h3>Final Thoughts</h3>
<p>Ext JS is a great framework and the Ext core that is largely shared between Ext JS and Sencha Touch is a powerful programming model for HTML5 based applications. It&rsquo;s made our developers more efficient and has helped us to evolve KiteDesk quickly.</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Thu, 04 Apr 2013 16:00 GMT</pubDate>
        <guid>http://www.sencha.com/blog/ext-js-spotlight-kitedesk/#date:16:00</guid>
        </item>
        
        <item>
        <title>Using the GWT Compiler for Better Builds</title>
        <author>Colin Alworth</author>
        <description>
            Many developers use Sencha GXT and GWT to help their teams produce structured, powerful, and maintainable web applications. In this article, we&amp;rsquo;ll discuss several different ways to customize what the compiler is building for you, and how it can impact build times and output sizes.
        </description>
        <link>http://www.sencha.com/blog/using-the-gwt-compiler-for-better-builds/</link>
        <content:encoded>
            <![CDATA[
                <p><img src="http://cdn.sencha.io/img/20130317-gwt-compiler.png" alt="GWT Compiler" width="120" class="alignright">Many of us use Sencha GXT and GWT to help our teams produce structured, powerful, and maintainable web applications. With Dev Mode and Super Dev Mode, we can easily write Java and test how it behaves in the browser. The Compiler then produces optimized code to run in our users&rsquo; browsers.</p>

<p>It turns out that the compiler is customizable, and can be instructed to change its output based on your needs, to produce a better build. What is a better build though? This definition will change based on the project, and based on the team member. For many developers, the best build is the one that happens as fast as possible, letting you get straight to testing. For some teams, the best build is often the one that produces the smallest browser download, or sometimes the smallest total compiled size.</p>

<p>In this article, we&rsquo;ll discuss several different ways to customize what the compiler is building for you, and how it can impact build times and output sizes. We&rsquo;ll use the Sencha GXT Explorer as an example. While it is not as complex as many applications out there, it does use almost every single widget Sencha GXT has to offer. Using Sencha GWT 2.4.0 and GXT 3.0.4, the Explorer builds in about 183 seconds, and the largest permutation is 2,608,783 bytes.</p>

<h3>Permutations</h3>
<p>A &lsquo;normal&rsquo; build is one where you get 6 basic permutations, one for each category of browser. These have been selected by the GWT team as related enough to always treat as the same. These browsers are:</p>
  <ul>
    <li>Firefox, all versions</li>
    <li>All Webkit browsers (Safari, Chrome, Android Browser, etc)</li>
    <li>IE6 and IE7</li>
    <li>IE8</li>
    <li>IE9 (and IE10)</li>
    <li>Opera</li>
  </ul>

<p>GXT is configured by default to use these same 6 permutations &mdash; it is a good middle ground between all possible configurations and lumping everything together. GXT adds several possible browsers that are not normally listed &mdash; IE6 and IE7 are kept apart, as are IE9 and IE10. Chrome and Safari are treated as two different browsers, with several distinct versions, where required. Firefox is lumped into two categories &mdash; before Gecko 1.9 and after, allowing for some tests of specific cases. GXT also adds another degree of possibility &mdash; Operating System. There are unique features to each OS that make it important to allow GXT to tell the difference.</p>

<p>With all of these variations in the build, it&rsquo;s possible to end up with 52 permutations in 3.0.4! This makes the build times much longer than the normal 6 permutations &mdash; but do we gain anything?</p>

<p>To test this question, I made a few changes to the application&rsquo;s module file. Instead of</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.xml .imp {font-weight: bold; color: red;}
.xml .es0 {color: #000099; font-weight: bold;}
.xml .br0 {color: #66cc66;}
.xml .sy0 {color: #66cc66;}
.xml .st0 {color: #ff0000;}
.xml .sc-1 {color: #808080; font-style: italic;}
.xml .sc0 {color: #00bbdd;}
.xml .sc1 {color: #ddbb00;}
.xml .sc2 {color: #339933;}
.xml .sc3 {color: #009900;}
.xml .re0 {color: #000066;}
.xml .re1 {color: #000000; font-weight: bold;}
.xml .re2 {color: #000000; font-weight: bold;}
.xml span.xtra { display:block; }
</style><pre class="xml">&nbsp;
  <span class="sc3"><span class="re1">&lt;inherits</span> <span class="re0">name</span>=<span class="st0">&quot;com.sencha.gxt.ui.GXT&quot;</span> <span class="re2">/&gt;</span></span>
&nbsp;</pre>

<p>which is the standard inherits statement to load GXT, I replaced this statement with the specific modules we were interested in. We can load just the widgets and the State handling code instead, as well as a theme:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.xml .imp {font-weight: bold; color: red;}
.xml .es0 {color: #000099; font-weight: bold;}
.xml .br0 {color: #66cc66;}
.xml .sy0 {color: #66cc66;}
.xml .st0 {color: #ff0000;}
.xml .sc-1 {color: #808080; font-style: italic;}
.xml .sc0 {color: #00bbdd;}
.xml .sc1 {color: #ddbb00;}
.xml .sc2 {color: #339933;}
.xml .sc3 {color: #009900;}
.xml .re0 {color: #000066;}
.xml .re1 {color: #000000; font-weight: bold;}
.xml .re2 {color: #000000; font-weight: bold;}
.xml span.xtra { display:block; }
</style><pre class="xml">&nbsp;
  <span class="sc3"><span class="re1">&lt;inherits</span> <span class="re0">name</span>=<span class="st0">&quot;com.sencha.gxt.widget.core.Core&quot;</span> <span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;inherits</span> <span class="re0">name</span>=<span class="st0">&quot;com.sencha.gxt.state.State&quot;</span> <span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;inherits</span> <span class="re0">name</span>=<span class="st0">&quot;com.sencha.gxt.theme.blue.Blue&quot;</span> <span class="re2">/&gt;</span></span>
&nbsp;</pre>

<p>At present, Charts do not allow for this particular change, so I had to make the same change to the Charts.gwt.xml file to allow it to make this change overall.</p>

<p>This is a massive overkill and doesn&rsquo;t save us much. The largest permutation is now down to 2,587,780 bytes &mdash; a difference of about 21K, or a savings of less than 1%, and the build took 20 minutes, up from about 3 minutes. Interestingly, it also only produced 26 actual permutations &mdash; while the OS check allows our code to differentiate between Windows/Mac/Linux/Unknown, it turns out that we rarely need to take advantage of this check, so half of our build time is essentially wasted. We&rsquo;re still seeing savings though &mdash; some teams may find it worthwhile to create very specific builds for supported browsers, then limit which browsers they support when debugging and allow very long builds for production.</p>

<p>We can also take this in the other direction in two different ways by combining browsers into fewer permutations or by limiting which browsers we intend to support.</p>

<p>First, we can restrict which browsers we intend to support:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.xml .imp {font-weight: bold; color: red;}
.xml .es0 {color: #000099; font-weight: bold;}
.xml .br0 {color: #66cc66;}
.xml .sy0 {color: #66cc66;}
.xml .st0 {color: #ff0000;}
.xml .sc-1 {color: #808080; font-style: italic;}
.xml .sc0 {color: #00bbdd;}
.xml .sc1 {color: #ddbb00;}
.xml .sc2 {color: #339933;}
.xml .sc3 {color: #009900;}
.xml .re0 {color: #000066;}
.xml .re1 {color: #000000; font-weight: bold;}
.xml .re2 {color: #000000; font-weight: bold;}
.xml span.xtra { display:block; }
</style><pre class="xml">&nbsp;
  <span class="sc3"><span class="re1">&lt;inherits</span> <span class="re0">name</span>=<span class="st0">&quot;com.sencha.gxt.ui.GXT&quot;</span> <span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;set-property</span> <span class="re0">name</span>=<span class="st0">&quot;gxt.user.agent&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;ie9, ie10, gecko1_9, safari5, chrome, opera&quot;</span> <span class="re2">/&gt;</span></span>
&nbsp;</pre>

<p>By inheriting GXT again, and limiting the browsers we are most interested in, we are limiting the build down to 4 permutations &mdash; ie8, ie9/ie10, gecko1_9, and safari5/chrome. These 6 browsers only require 4 permutations because once again, we are condensing similar browsers into the same build. By following the previous step (not inheriting GXT directly), we can expand this back to 6 if we wanted &mdash; and be slightly more specialized than we were to begin with. Or, we can keep our smaller set. With this smaller set, we can compile in about 140 seconds, and the largest of our four permutations is 2,608,785 bytes, about the same as we started.</p>

<p>The second option is to further condense supported browsers into fewer permutations. There are two tools for this option and both rely on the idea of merging permutations. First, we can specify that one or more property should be collapsed:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.xml .imp {font-weight: bold; color: red;}
.xml .es0 {color: #000099; font-weight: bold;}
.xml .br0 {color: #66cc66;}
.xml .sy0 {color: #66cc66;}
.xml .st0 {color: #ff0000;}
.xml .sc-1 {color: #808080; font-style: italic;}
.xml .sc0 {color: #00bbdd;}
.xml .sc1 {color: #ddbb00;}
.xml .sc2 {color: #339933;}
.xml .sc3 {color: #009900;}
.xml .re0 {color: #000066;}
.xml .re1 {color: #000000; font-weight: bold;}
.xml .re2 {color: #000000; font-weight: bold;}
.xml span.xtra { display:block; }
</style><pre class="xml">&nbsp;
  <span class="sc3"><span class="re1">&lt;inherits</span> <span class="re0">name</span>=<span class="st0">&quot;com.sencha.gxt.widget.core.Core&quot;</span> <span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;inherits</span> <span class="re0">name</span>=<span class="st0">&quot;com.sencha.gxt.state.State&quot;</span> <span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;inherits</span> <span class="re0">name</span>=<span class="st0">&quot;com.sencha.gxt.theme.blue.Blue&quot;</span> <span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;set-property</span> <span class="re0">name</span>=<span class="st0">&quot;gxt.user.agent&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;ie9, ie10, gecko1_9, safari5, chrome, opera&quot;</span> <span class="re2">/&gt;</span></span>
&nbsp;
  <span class="sc-1">&lt;!-- merge gecko1_9, safar5, and chrome into one permutation --&gt;</span>
  <span class="sc3"><span class="re1">&lt;collapse-property</span> <span class="re0">name</span>=<span class="st0">&quot;gxt.user.agent&quot;</span> <span class="re0">values</span>=<span class="st0">&quot;gecko1_9, safari5, chrome&quot;</span> <span class="re2">/&gt;</span></span>
&nbsp;
  <span class="sc-1">&lt;!-- merge ie9 and ie10 into one permutation with a wildcard--&gt;</span>
  <span class="sc3"><span class="re1">&lt;collapse-property</span> <span class="re0">name</span>=<span class="st0">&quot;gxt.user.agent&quot;</span> <span class="re0">values</span>=<span class="st0">&quot;ie*&quot;</span> <span class="re2">/&gt;</span></span>
  <span class="sc-1">&lt;!-- merge all operating system permutations --&gt;</span>
  <span class="sc3"><span class="re1">&lt;collapse-property</span> <span class="re0">name</span>=<span class="st0">&quot;user.agent.os&quot;</span> <span class="re0">values</span>=<span class="st0">&quot;*&quot;</span> <span class="re2">/&gt;</span></span>
&nbsp;</pre>
  
<p>This gives us a different set of 4 permutations, the largest at 2,608,785 bytes, and completes in 144 seconds &mdash; still faster than our baseline, supporting fewer browsers, and at nearly the same size.</p>

<p>Finally we can tell the compiler that every single property should be collapsed into one permutation:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.xml .imp {font-weight: bold; color: red;}
.xml .es0 {color: #000099; font-weight: bold;}
.xml .br0 {color: #66cc66;}
.xml .sy0 {color: #66cc66;}
.xml .st0 {color: #ff0000;}
.xml .sc-1 {color: #808080; font-style: italic;}
.xml .sc0 {color: #00bbdd;}
.xml .sc1 {color: #ddbb00;}
.xml .sc2 {color: #339933;}
.xml .sc3 {color: #009900;}
.xml .re0 {color: #000066;}
.xml .re1 {color: #000000; font-weight: bold;}
.xml .re2 {color: #000000; font-weight: bold;}
.xml span.xtra { display:block; }
</style><pre class="xml">&nbsp;
  <span class="sc3"><span class="re1">&lt;collapse-all-properties</span> <span class="re2">/&gt;</span></span>
&nbsp;</pre>

<p>This is the big one &mdash; no matter how many permutations you had configured before this line, only one file will be created. This is especially handy for very fast builds or cases where you want to keep the build size small (such as only one 1.5MB file instead of six 1.0MB files). In the case of the Explorer, we bring the compiled size up to 3,376,120 bytes, about 700K larger, but the compile time drops to just over a minute, from just over three minutes. The total compiled directory also drops in size, from about 22MB to less than 6MB.</p>

<p>If you would like more information, you can learn about <a href="http://code.google.com/p/google-web-toolkit/wiki/ConditionalProperties" target="_new">properties</a> and <a href="http://code.google.com/p/google-web-toolkit/wiki/SoftPermutations" target="_new">permutations</a> on the GWT wiki.</p>

<h3>Optimization levels and other flags</h3>

<p>When the GWT compiler rewrites Java into JavaScript, it transforms the code in many ways. Some rewrites are necessary to change Java expressions into JavaScript &mdash; instanceof operators and casts are turned into method calls, and all classes and inheritance are tracked in a lookup table. It also looks for cases where code is easy to read but hard to execute, and rewrites them &mdash; fields left at their default values are turned into constants and sometimes compiled away, among many others. All modifications to the way the optimizer works are set when running the compiler, not in the module files. How you set these modifications may vary based on how you build your project &mdash; for command line and Ant users, these are arguments passed to the compiler, while for Maven users these are configuration options.</p>

<h4>Faster builds</h4>
<p>By default, the compiler runs and runs until it is no longer making a difference in the files it is touching. For many applications, this results in 8 to 15 steps through the optimizer before starting on browser-specific details. This too is configurable, but must always be run at least once to properly transform Java into JavaScript. If we set the optimization level to 0, we are asking for as little optimization to be done as possible, whereas setting it to 9 (the default) asks the compiler to run until it is no longer able to find anything to optimize.</p>

<p>There is also a set of expensive optimizations called &lsquo;Aggressive Optimizations&rsquo;. By default, these are enabled but can be turned off.</p>

<p>There is also a handy option called &lsquo;draft mode&rsquo; &mdash; activating this option disables all aggressive optimizations and turns down the optimization level at the same time. This is the easiest way to limit the effort that the compiler is putting into building an app. Just turning on draft mode brings the Explorer build time down to 103 seconds, from 180, though it raises the size of the largest permutation to 3,426,639 bytes, some 800K larger. Combined with the collapse-all-permutations directive in the module, the compile time drops further to 49 seconds &mdash; less than a minute! Predictably, the compiled size also grows, now up to 4,459,653 bytes which is not a problem for local debugging, but not something you&rsquo;d want to serve over the Internet to users&rsquo; browsers.</p>

<p><strong>GWT Compiler:</strong></p>
    <p style="margin-left:20px;">Pass the -draftCompile flag to the compiler</p>
<p><strong>GWT-Maven-Plugin:</strong></p>
    <p style="margin-left:20px;">Either set <code>&lt;draftCompile&gt;true&lt;/draftCompile&gt;</code> in the plugin configuration, or set the gwt.draftCompile property to true</p>

<h4>Smaller apps</h4>
<p>There are also flags that can decrease the compiled size of the app by overly simplifying code. These flags are not a fit for every project but are worth considering. The first is to skip class metadata. This causes Class.getName() to return some generic string instead of the usual "org.package.to.my.client.Object", thus decreasing the number of strings that need to be baked into the output. Most applications don&rsquo;t depend on those strings being the same every time, but you&rsquo;ll need to consider your use cases.</p>

<p><strong>GWT Compiler:</strong></p>
    <p style="margin-left:20px;">Pass the -XdisableClassMetadata flag to the compiler</p>
<p><strong>GWT-Maven-Plugin:</strong></p>
    <p style="margin-left:20px;">Either set <code>&lt;disableClassMetaData&gt;true&lt;/disableClassMetadata&gt;</code> in the plugin configuration, or set the gwt.disableClassMetadata property to true</p>
    
<p>This saves Explorer about 3.5%, bringing the size to 2,522,282 bytes. The compile time doesn&rsquo;t change much, since we&rsquo;re just removing the strings that are used to describe the packages and classes.</p>

<p>The second flag is somewhat more invasive, by removing all ClassCastExceptions from your compiled code. Where Java has a cast operator, letting you specify that you want to treat an object of type A as if it were type B, JavaScript has no such concept, so all type checks must be added through synthetic code. A block like</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
    <span class="kw1">if</span> <span class="br0">&#40;</span>obj <span class="kw1">instanceof</span> HasMethod<span class="br0">&#41;</span> <span class="br0">&#123;</span>
    	HasMethod hasMethod <span class="sy0">=</span> <span class="br0">&#40;</span>HasMethod<span class="br0">&#41;</span> obj<span class="sy0">;</span>
    	hasMethod.<span class="me1">doSomething</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;</pre>

<p>will by default compile to something like:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
  <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw1">instanceOf</span><span class="br0">&#40;</span>obj<span class="sy0">,</span> <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
  	hasMethod <span class="sy0">=</span> dynamicCast<span class="br0">&#40;</span>obj<span class="sy0">,</span> <span class="nu0">5</span><span class="br0">&#41;</span><span class="sy0">;</span>
  	hasMethod.<span class="me1">doSomething</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
  <span class="br0">&#125;</span>
&nbsp;</pre>

<p>If you enable this feature, instead, the compiled JavaScript will be something more like:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
  <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw1">instanceOf</span><span class="br0">&#40;</span>obj<span class="sy0">,</span> <span class="nu0">5</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
  	hasMethod <span class="sy0">=</span> obj<span class="sy0">;</span>
  	hasMethod.<span class="me1">doSomething</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
  <span class="br0">&#125;</span>
&nbsp;</pre>

<p>This flag will also remove other cast operations elsewhere in your application. It can often be a good thing &mdash; the very fastest code is code that never runs &mdash; but you will miss out on any unexpected ClassCastExceptions in your compiled application. Instead, you&rsquo;ll either see no errors at all, or you&rsquo;ll see the JavaScript equivalent of a null pointer when a method or field is referenced. If you see such an error in production, you can run in Dev mode or without this flag set, and you will see the correct error.</p>

<p><strong>GWT Compiler:</strong></p>
    <p style="margin-left:20px;">Pass the -XdisableCastChecking flag to the compiler</p>
<p><strong>GWT-Maven-Plugin:</strong></p>
    <p style="margin-left:20px;">Either set <code>&lt;disableCastChecking&gt;true&lt;/disableCastChecking&gt;</code> in the plugin configuration, or set the gwt.disableCastChecking property to true</p>

<p>By itself, removing cast checking saves less than 2%, though this can also have significant impacts on runtime performance by avoiding useless checks. As with the class metadata, dropping cast checks does not have much impact on compile times.</p>

<p>Enabling both of these features takes roughly the same amount of time to compile, and removing this possibly useless extra data and checks drops the compiled size by about 6%, down to 2,461,611 bytes.</p>

<h3>CssResource classnames</h3>
<p>Next, we have a configuration change that can be made to the way CssResources are generated by ClientBundle. By default, ClientBundle assumes that there might be more than one application running on the page and care should be taken to generated CSS classes, so they will never conflict. This set of features can be customized in several ways, either to make debugging easier or to make the application size smaller.</p>

<p>GXT 3 makes heavy use of CssResources and ClientBundles. They hold all of the styles and images used to render and update widgets. The <a href="http://www.sencha.com/blog/ext-gwt-3-appearance-design" target="_new">appearance pattern</a> lets the compiler include only the CSS that is actually used, making for smaller applications and more optimized styles.</p>

<p>If you know that no other content needs to be rendered except your application, you can remove all of that extra prefixing. This enables ClientBundle to rename all CSS classes to very short strings, usually less than three characters.</p>

<p>To enable this feature, add this line to your module file:</p>
<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.xml .imp {font-weight: bold; color: red;}
.xml .es0 {color: #000099; font-weight: bold;}
.xml .br0 {color: #66cc66;}
.xml .sy0 {color: #66cc66;}
.xml .st0 {color: #ff0000;}
.xml .sc-1 {color: #808080; font-style: italic;}
.xml .sc0 {color: #00bbdd;}
.xml .sc1 {color: #ddbb00;}
.xml .sc2 {color: #339933;}
.xml .sc3 {color: #009900;}
.xml .re0 {color: #000066;}
.xml .re1 {color: #000000; font-weight: bold;}
.xml .re2 {color: #000000; font-weight: bold;}
.xml span.xtra { display:block; }
</style><pre class="xml">&nbsp;
<span class="sc3"><span class="re1">&lt;set-configuration-property</span> <span class="re0">name</span>=<span class="st0">&quot;CssResource.obfuscationPrefix&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;empty&quot;</span> <span class="re2">/&gt;</span></span>
&nbsp;</pre>

<p>This isn&rsquo;t a terribly powerful optimization, but every little bit helps. This change has no impact on compile times and brings the Explorer size down to 2,607,442 bytes, a savings of only about 1K.</p>

<h3>Keep GWT and GXT up to date</h3>
<p>One final thing we can do is keep the compiler up to date. While the main GWT library code isn&rsquo;t changing too much beyond keeping up with browsers and fixing bugs, the compiler itself is slowly incorporating changes, fixes and improvements.</p>

<p>If you use UiBinder, don&rsquo;t forget to remove the uibinder-bridge jar from your classpath and the inherits from your module. It is no longer necessary when using GWT 2.5.0 or later.</p>

<p>By itself, switching to GWT 2.5.0 brought the default build down to 2,388,364 bytes &mdash; almost 10% savings or about 200K, though it seemed to increase compile times slightly.</p>

<h3>The Closure Compiler</h3>
<p>The release of GWT 2.5.0 brought an additional compilation step that can be added to the process. The Closure Compiler, a JavaScript optimizing compiler, is able to rewrite JavaScript that follows certain rules to be smaller and more efficient. While many of these same optimizations are available to the GWT compiler, there are some that are not present. Allowing the Closure Compiler to run after GWT has done its work can often take a pretty big chunk out of the compiled size.</p>

<p>While any GWT/Java code is already compatible with the Closure Compiler, some JSNI is not. As part of the GXT 3.0.4 release, we&rsquo;ve made some internal changes to ensure that this optimization will not break GXT applications.</p>

<p>While this produces smaller downloads, it comes at a cost &mdash; compile times can skyrocket, depending on the size of the application. This optimization must be performed on each permutation of the application, after it has been compiled, which can negatively affect multi-permutation apps.</p>

<p><strong>GWT Compiler:</strong></p>
    <p style="margin-left:20px;">Pass the -XenableClosureCompiler flag to the compiler</p>
<p><strong>GWT-Maven-Plugin:</strong></p>
    <p style="margin-left:20px;">Either set <code>&lt;enableClosureCompiler&gt;true&lt;/enableClosureCompiler&gt;</code> in the plugin configuration, or set the gwt.compiler.enableClosureCompiler property to true</p>

<p>Enabling just the Closure Compiler saved an additional 20K over just switching to 2.5.0, bringing the compiled size to 2,388,364 bytes, though adding over four minutes to the build time. This is less than the combined savings of disabling cast checks, class metadata, and CSS classname prefixes, but on the other hand, it can stack with those optimizations. Combining all of these optimizations brings the compiled size down to just over 2MB, an overall savings of 300K, or 15%.</p>

<h3>Combining these optimizations</h3>
<p>Based on all of these options, what seems to be the &lsquo;best&rsquo; set of optimizations?</p>

<p>Smallest individual permutations (best for production):</p>
<ul>
<li>Switch to GWT 2.5.0</li>
<li>Enable Closure Compiler</li>
<li>Disable Class cast checks and Class metadata</li>
<li>Disable CSS class name prefixes</li>
</ul>

<p>Rapid compilation:</p>
<ul>
<li>Select only desired browsers (optional)</li>
<li>Collapse all permutations into one</li>
<li>Enable Draft mode</li>
</ul>

<p>If you need very small total output (such as for compiling for embedded servers), you can mix and match &mdash; enable the compiler to do as much work as possible and leave draft mode off, but collapse all properties into one permutation.</p>

<a href="http://cdn.sencha.io/img/20130317-gwt-compiler/gwt-compiler-1.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-gwt-compiler/gwt-compiler-1.png" alt="GWT Compiler" width="500" class="aligncenter"></a>

<a href="http://cdn.sencha.io/img/20130317-gwt-compiler/gwt-compiler-2.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-gwt-compiler/gwt-compiler-2.png" alt="GWT Compiler" width="636" class="aligncenter"></a>

<h4>Legend</h4>
<ul>
<li><strong>A</strong> &mdash; draft</li>
<li><strong>B</strong> &mdash; collapse-all</li>
<li><strong>C</strong> &mdash; disableClassMetaData</li>
<li><strong>D</strong> &mdash; disableClassChecking</li>
<li><strong>E</strong> &mdash; empty css classname prefix</li>
<li><strong>F</strong> &mdash; Closure Compiler (GWT 2.5 and above only)</li>
</ul>

<p>In these charts we can see that there is nearly an inverse relationship between compiled size and time &mdash; the longer we let the compiler work, the more productive it can be. At its best, the compiler can either finish the Explorer in under a minute, or just over 2MB. However, it&rsquo;s important to note that build times are somewhat inconsistent &mdash; building with the same settings does not always complete in the same amount of time.</p>

<h3>Conclusion</h3>
<p>What we get out of a build depends, of course, on the code we put in, but also on how we ask the compiler to produce the output. By specifying what work we need or do not need to have done, we can choose that additional work be completed, or that the build be finished as soon as possible.</p>

<p>What do you need out of your build?</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Tue, 02 Apr 2013 16:00 GMT</pubDate>
        <guid>http://www.sencha.com/blog/using-the-gwt-compiler-for-better-builds/#date:16:00</guid>
        </item>
        
        <item>
        <title>Announcing Sencha Blink 1.0</title>
        <author>Michael Mullany</author>
        <description>
            Today we&amp;rsquo;re pleased to announce the first release of Sencha Blink, a cross platform UI toolkit for the coming wave of spectacle-based devices. Sencha Blink offers a full set of display components, fully abstracted eye events (using the new W3C HTML5 Eye Events), and a rich set of image query primitives.
        </description>
        <link>http://www.sencha.com/blog/announcing-sencha-blink-1-0/</link>
        <content:encoded>
            <![CDATA[
                <p><img src="http://cdn.sencha.io/img/20130401-sencha-blink-preview.png" alt="Sencha Blink 1.0" width="150" style="margin-bottom:15px;" class="rounded shadow alignright">Today we&rsquo;re pleased to announce the first release of Sencha Blink, a cross platform UI toolkit for the coming wave of spectacle-based devices. Sencha Blink offers a full set of display components, fully abstracted eye events (using the new W3C HTML5 Eye Events), and a rich set of image query primitives. It also offers a breakthrough input system that replaces traditional keyboard entry based on eye blinks. Sencha Blink currently supports Google Glass, but we hope to soon support the forthcoming Apple iPane, and Microsoft EyeWindows Premium Home Edition.</p>

<h3>Display Components</h3>
<p>Sencha Blink&rsquo;s flagship component is the Ext.grid.eyeGrid (xtype: eyegrid), a port of the Ext JS grid to spectacle-based devices. Scrolling an eyeGrid is as simple as focusing on the scrollbar and then making a quick eyeroll. Activation time thresholds can be specified in the configuration. Cut and paste is activated by glaring at the target cell, pinching your eye shut and then re-opening your eye while focused on the destination cell. In our usability tests, no more than 1 minute of practice was required to achieve a 95% success rate with this operation. </p>

<p>But what makes Sencha Blink most exciting is our system of transparent overlays. We use Canvas and hardware-accelerated real-time image filtering to automatically tag appropriate elements in the currently viewed scene. We&rsquo;re shipping the following example overlays to better power your applications. </p>

<ul>
	<li><strong>HomelessOrHipster</strong>: an overlay that correctly identifies over 90% of the time whether that guy is wearing expensive vintage clothes or is actually homeless.</li>

	<li><strong>SprayTan</strong>: this overlay selectively desaturates the orange glow from spraytan using ColorMatrix transforms. We&rsquo;ve made this even more accurate by using the CIELab color space rather than the traditional RGB space. </li>
	
	<li><strong>FoodOrMole</strong>: if you&rsquo;ve ever done the &ldquo;you&rsquo;ve got food on your cheek&rdquo; gesture, only to find out that the person actually has a mole, you&rsquo;ll recognize the utility of this overlay.</li>
	
	<li><strong>FiveSecondRule</strong>: whenever some food item falls from your hands, we object track and clock the amount of time that food object has been on the ground. Of course, you can use configurations if you follow a TenSecondRule.</li>
</ul>

<p>Stay tuned for tutorials on how to create your own custom overlays. </p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
<span class="br0">&#123;</span>
   xtype<span class="sy0">:</span><span class="st0">'eyegrid'</span><span class="sy0">,</span>
   config<span class="sy0">:</span><span class="br0">&#123;</span>
      overlay<span class="sy0">:</span><span class="st0">'hipsterorhomeless'</span><span class="sy0">,</span>
      sensitivity<span class="sy0">:</span><span class="st0">'medium'</span><span class="sy0">,</span>
      vendor<span class="sy0">:</span><span class="st0">'googleglasses'</span>
   <span class="br0">&#125;</span><span class="sy0">,</span>
   listeners<span class="sy0">:</span><span class="br0">&#123;</span>
      onBlink<span class="sy0">:</span>myOnBlinkHandler
   <span class="br0">&#125;</span>
<span class="br0">&#125;</span>
&nbsp;</pre>

<h3>Eye Gestures</h3>
<p>Since each spectacle device ships incompatible gestures (the Google Glass onStare vs. the iPane onGlare) we&rsquo;ve shipped a set of gesture abstractions. Sencha Blink 1.0 supports the following gestures: onPinch, onEyeRoll, onFlutter, onOgle, onGaze, onWink, onDoubleTake. For standard usage see our &ldquo;Staring Match&rdquo; demo application. </p>

<h3>Innovative Keyboard Replacement</h3>
<p>Sencha Blink ships an amazing replacement for traditional keyboard input: the Morser component. Users can activate this component by simply blinking the Morse Code sequence for &ldquo;Open Keyboard&rdquo;. Once this occurs a keyboard overlay will pop up, ready to receive Morse Code input via eye blinks. With the layout system we&rsquo;re known for, Blink components know how to move out of the way and beautifully reflow the &ldquo;document&rdquo; to adapt for the Morser keyboard. </p>

<h3>And Even More</h3>
<p>We&rsquo;re also announcing two optional accessories that work with Sencha Blink. The first is &ldquo;KeepItDown&rdquo; &mdash; a powerful loudspeaker equipped with a System on a Chip. If the user&rsquo;s environment is too noisy for audio input, KeepItDown will blare &ldquo;Hey guys can you keep it down, I&rsquo;m trying to use my [device name]&rdquo;. The whine level is configurable. The second is &ldquo;Hide-My-Glasses&rdquo; a clever accessory that disguises your user&rsquo;s spectacle under a wig and pirate patch. We even have an early adopter.</p>

<img src="http://cdn.sencha.io/img/20130401-sencha-blink.png" width="636" alt="Sencha Blink" class="rounded">

<h3>Start Your Engines</h3>
<p>We&rsquo;re excited to launch Sencha Blink. We look forward to seeing your furious Morse Code blinks on the streets soon!</p>

                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Mon, 01 Apr 2013 14:05 GMT</pubDate>
        <guid>http://www.sencha.com/blog/announcing-sencha-blink-1-0/#date:14:05</guid>
        </item>
        
        <item>
        <title>mzPivotGrid: A pivot table for Ext JS</title>
        <author>Adrian Teodorescu</author>
        <description>
            The Ext JS grid panel is perfect for displaying large sets of data, and it has many features for all kinds of data display. One type of data display that it doesn't provide is a pivot grid. In this article, guest blogger Adrian Teodorescu introduces you to mzPivotGrid, a component that you can use with Sencha Ext JS to create pivot grids.
        </description>
        <link>http://www.sencha.com/blog/mzpivotgrid-a-pivot-table-for-ext-js/</link>
        <content:encoded>
            <![CDATA[
                <p style="color:white;background-color:green;padding:5px;" class="rounded"><strong>Guest Blog Post</strong></p>

<p>At <a href="http://www.mzsolutions.eu/" target="_new">mzSolutions</a>, I work on creating components for Ext JS and Sencha Touch. In this post, I will show you how to use mzPivotGrid with Sencha Ext JS.</p>

<h3>What is a pivot grid?</h3>
<p>The Ext JS grid panel is perfect for displaying large sets of data, and it provides many features for all kinds of data display. One type of data display that it doesn&rsquo;t provide is a <a href="http://en.wikipedia.org/wiki/Pivot_table#Explanation_of_a_pivot_table" target="_new">pivot grid</a>. When it comes to reporting, a pivot grid is the way to go because it helps you organize and summarize data and create reports; and it enables users to make more informed decisions about their data.</p>

<h3>What is mzPivotGrid</h3>
<p>mzPivotGrid is a component that you can use with Ext JS to create a pivot grid. Let&rsquo;s imagine the following scenario. You have some sales data with the following fields: country, salesperson, order date, order amount and order ID. If you want to edit this data, you could easily use an Ext JS GridPanel with CellEditing or RowEditing plugins.</p>

<a href="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-1.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-1.png" alt="Pivot Grid" width="636" class="rounded shadow aligncenter"></a>

<p>What would you do if you had to answer the following questions?</p>
<ol>
<li>What are the order amounts of each salesperson?</li>
<li>What are the order amounts of each salesperson in a specific country?</li>
<li>How did salespeople perform in a specific year?</li>
</ol>

<p>You could use mzPivotGrid to create those reports, and this is how they would look:</p>

<a href="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-2.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-2.png" alt="Pivot Grid" width="636" class="rounded shadow aligncenter"></a>

<a href="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-3.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-3.png" alt="Pivot Grid" width="636" class="rounded shadow aligncenter"></a>

<a href="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-4.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-4.png" alt="Pivot Grid" width="636" class="rounded shadow aligncenter"></a>

<h3>Using mzPivotGrid</h3>
<p>mzPivotGrid inherits the Ext JS Grid Panel component, so you can use most of the features you are already familiar with: column resizing, locking, cell renderers, row/cell events etc. The mzPivotGrid can be used when you want to get summation and pivot features that aren&rsquo;t provided in the default GridPanel.</p>

<p>To break down the dataset into salespeople and years, you just have to configure the top and left axis:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
leftAxis<span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
    width<span class="sy0">:</span>      <span class="nu0">80</span><span class="sy0">,</span>
    dataIndex<span class="sy0">:</span>  <span class="st0">'salesperson'</span><span class="sy0">,</span>
    header<span class="sy0">:</span>     <span class="st0">'Salesperson'</span>
<span class="br0">&#125;</span><span class="br0">&#93;</span><span class="sy0">,</span>
&nbsp;
topAxis<span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
    dataIndex<span class="sy0">:</span>  <span class="st0">'year'</span><span class="sy0">,</span>
    header<span class="sy0">:</span>     <span class="st0">'Year'</span><span class="sy0">,</span>
    direction<span class="sy0">:</span>  <span class="st0">'ASC'</span>
<span class="br0">&#125;</span><span class="br0">&#93;</span>
&nbsp;</pre>

<p>Multiple levels are supported, so you can just specify them in the top and left axis. Grouping the rows and/or columns could be handy here, so you can simply do that by setting &ldquo;enableGrouping&rdquo; to true.</p>

<p>Now that you broke down the dataset on the top and left axis, it&rsquo;s time to aggregate the cell values. Several kinds of aggregations are available including: sum, average, min, max, count etc. If these are not enough, you can provide your own aggregation function.</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
aggregate<span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
    measure<span class="sy0">:</span>    <span class="st0">'amount'</span><span class="sy0">,</span>
    header<span class="sy0">:</span>     <span class="st0">'Sales'</span><span class="sy0">,</span>
    aggregator<span class="sy0">:</span> <span class="st0">'sum'</span><span class="sy0">,</span>
    align<span class="sy0">:</span>      <span class="st0">'right'</span><span class="sy0">,</span>
    width<span class="sy0">:</span>      <span class="nu0">85</span><span class="sy0">,</span>
    renderer<span class="sy0">:</span>   Ext.<span class="me1">util</span>.<span class="me1">Format</span>.<span class="me1">numberRenderer</span><span class="br0">&#40;</span><span class="st0">'0,000.00'</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span><span class="sy0">,</span><span class="br0">&#123;</span>
    measure<span class="sy0">:</span>    <span class="st0">'orderid'</span><span class="sy0">,</span>
    header<span class="sy0">:</span>     <span class="st0">'Qnt'</span><span class="sy0">,</span>
    aggregator<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span>records<span class="sy0">,</span> measure<span class="sy0">,</span> matrix<span class="sy0">,</span> rowGroupKey<span class="sy0">,</span> colGroupKey<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="co1">// do your own algorithm</span>
        <span class="kw1">return</span> records.<span class="me1">length</span><span class="sy0">;</span>
    <span class="br0">&#125;</span><span class="sy0">,</span>
    align<span class="sy0">:</span>      <span class="st0">'right'</span><span class="sy0">,</span>
    width<span class="sy0">:</span>      <span class="nu0">85</span><span class="sy0">,</span>
    renderer<span class="sy0">:</span>   Ext.<span class="me1">util</span>.<span class="me1">Format</span>.<span class="me1">numberRenderer</span><span class="br0">&#40;</span><span class="st0">'0,000.00'</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span><span class="br0">&#93;</span>
&nbsp;</pre>

<p>As you have probably noticed in the above example, you could aggregate multiple data fields, say &ldquo;sales&rdquo; and &ldquo;quantity.&rdquo;  You can easily achieve this by configuring all required aggregations.</p>

<a href="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-5.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-5.png" alt="Pivot Grid" width="636" class="rounded shadow aligncenter"></a>

<p>Showing the grand totals for rows and/or columns is pretty easy to configure (&ldquo;enableRowGrandTotals: true&rdquo; or &ldquo;enableColGrandTotals: true&rdquo;). The group totals are also available via &ldquo;enableRowSummary&rdquo; and &ldquo;enableColSummary&rdquo; configs. Styling is also easy, and you can even define cell renderers.</p>

<p>The pivot grid uses any kind of Store available in Ext JS, so filtering the data is pretty easy to do on the Store object. This means you can implement a plugin to handle the filtering.</p>

<p>The Ext JS Data Model class is awesome, so you should use its powerful &ldquo;convert&rdquo; function to extend your model and break down your data in custom group intervals. Check out this example:</p>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
fields<span class="sy0">:</span> <span class="br0">&#91;</span>
	<span class="br0">&#123;</span><span class="kw3">name</span><span class="sy0">:</span> <span class="st0">'orderid'</span><span class="sy0">,</span>   	type<span class="sy0">:</span> <span class="st0">'int'</span><span class="br0">&#125;</span><span class="sy0">,</span>
	<span class="br0">&#123;</span><span class="kw3">name</span><span class="sy0">:</span> <span class="st0">'salesperson'</span><span class="sy0">,</span>   type<span class="sy0">:</span> <span class="st0">'string'</span><span class="br0">&#125;</span><span class="sy0">,</span>
	<span class="br0">&#123;</span><span class="kw3">name</span><span class="sy0">:</span> <span class="st0">'country'</span><span class="sy0">,</span>   	type<span class="sy0">:</span> <span class="st0">'string'</span><span class="br0">&#125;</span><span class="sy0">,</span>
	<span class="br0">&#123;</span><span class="kw3">name</span><span class="sy0">:</span> <span class="st0">'orderdate'</span><span class="sy0">,</span> 	type<span class="sy0">:</span> <span class="st0">'date'</span><span class="sy0">,</span> dateFormat<span class="sy0">:</span> <span class="st0">'d/m/Y'</span><span class="br0">&#125;</span><span class="sy0">,</span>
	<span class="br0">&#123;</span><span class="kw3">name</span><span class="sy0">:</span> <span class="st0">'amount'</span><span class="sy0">,</span>    	type<span class="sy0">:</span> <span class="st0">'int'</span><span class="br0">&#125;</span><span class="sy0">,</span>
	<span class="br0">&#123;</span>
    	<span class="kw3">name</span><span class="sy0">:</span> <span class="st0">'person-range'</span><span class="sy0">,</span>
    	convert<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span>v<span class="sy0">,</span> record<span class="br0">&#41;</span><span class="br0">&#123;</span>
            <span class="kw1">if</span><span class="br0">&#40;</span><span class="co2">/^[a-j]/i</span>.<span class="me1">test</span><span class="br0">&#40;</span>record.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'salesperson'</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw1">return</span> <span class="st0">'A-J'</span><span class="sy0">;</span>
            <span class="kw1">if</span><span class="br0">&#40;</span><span class="co2">/^[k-s]/i</span>.<span class="me1">test</span><span class="br0">&#40;</span>record.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'salesperson'</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw1">return</span> <span class="st0">'K-S'</span><span class="sy0">;</span>
            <span class="kw1">if</span><span class="br0">&#40;</span><span class="co2">/^[t-z]/i</span>.<span class="me1">test</span><span class="br0">&#40;</span>record.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'salesperson'</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw1">return</span> <span class="st0">'T-Z'</span><span class="sy0">;</span>
        	<span class="kw1">return</span> v<span class="sy0">;</span>
    	<span class="br0">&#125;</span>
	<span class="br0">&#125;</span><span class="sy0">,</span><span class="br0">&#123;</span>
    	<span class="kw3">name</span><span class="sy0">:</span> <span class="st0">'year'</span><span class="sy0">,</span>
    	convert<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span>v<span class="sy0">,</span> record<span class="br0">&#41;</span><span class="br0">&#123;</span>
        	<span class="kw1">return</span> Ext.<span class="me1">Date</span>.<span class="me1">format</span><span class="br0">&#40;</span>record.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'orderdate'</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="st0">&quot;Y&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    	<span class="br0">&#125;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#93;</span>
&nbsp;</pre>

<p>...it will look like this:</p>

<a href="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-6.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130317-mz-pivot-grid/pivot-grid-6.png" alt="Pivot Grid 1" width="636" class="rounded shadow aligncenter"></a>

<h3>A sample use case</h3>

<style>/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.javascript .imp {font-weight: bold; color: red;}
.javascript .kw1 {color: #000066; font-weight: bold;}
.javascript .kw2 {color: #003366; font-weight: bold;}
.javascript .kw3 {color: #000066;}
.javascript .co1 {color: #006600; font-style: italic;}
.javascript .co2 {color: #009966; font-style: italic;}
.javascript .coMULTI {color: #006600; font-style: italic;}
.javascript .es0 {color: #000099; font-weight: bold;}
.javascript .br0 {color: #009900;}
.javascript .sy0 {color: #339933;}
.javascript .st0 {color: #3366CC;}
.javascript .nu0 {color: #CC0000;}
.javascript .me1 {color: #660066;}
.javascript span.xtra { display:block; }
</style><pre class="javascript">&nbsp;
 <span class="kw2">var</span> pivotGrid <span class="sy0">=</span> Ext.<span class="me1">create</span><span class="br0">&#40;</span><span class="st0">'Mz.pivot.Grid'</span><span class="sy0">,</span> <span class="br0">&#123;</span>
    title<span class="sy0">:</span>          <span class="st0">'Pivot grid'</span><span class="sy0">,</span>
    height<span class="sy0">:</span>         <span class="nu0">400</span><span class="sy0">,</span>
    width<span class="sy0">:</span>          <span class="nu0">600</span><span class="sy0">,</span>
    enableLocking<span class="sy0">:</span>  <span class="kw2">false</span><span class="sy0">,</span>
    enableGrouping<span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span>
    viewConfig<span class="sy0">:</span> <span class="br0">&#123;</span>
        trackOver<span class="sy0">:</span>      <span class="kw2">true</span><span class="sy0">,</span>
        stripeRows<span class="sy0">:</span>     <span class="kw2">false</span>
    <span class="br0">&#125;</span><span class="sy0">,</span>
    store<span class="sy0">:</span> store<span class="sy0">,</span>
    aggregate<span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
        measure<span class="sy0">:</span>    <span class="st0">'amount'</span><span class="sy0">,</span>
        header<span class="sy0">:</span>     <span class="st0">'Sales'</span><span class="sy0">,</span>
        aggregator<span class="sy0">:</span> <span class="st0">'sum'</span><span class="sy0">,</span>
        align<span class="sy0">:</span>      <span class="st0">'right'</span><span class="sy0">,</span>
        width<span class="sy0">:</span>      <span class="nu0">85</span><span class="sy0">,</span>
        renderer<span class="sy0">:</span>   Ext.<span class="me1">util</span>.<span class="me1">Format</span>.<span class="me1">numberRenderer</span><span class="br0">&#40;</span><span class="st0">'0,000.00'</span><span class="br0">&#41;</span>
    <span class="br0">&#125;</span><span class="br0">&#93;</span><span class="sy0">,</span>
    caption<span class="sy0">:</span>  <span class="st0">'Sales report'</span><span class="sy0">,</span>
    leftAxis<span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
        width<span class="sy0">:</span>      <span class="nu0">80</span><span class="sy0">,</span>
        dataIndex<span class="sy0">:</span>  <span class="st0">'salesperson'</span><span class="sy0">,</span>
        header<span class="sy0">:</span>     <span class="st0">'Sales Person'</span>
    <span class="br0">&#125;</span><span class="br0">&#93;</span><span class="sy0">,</span>
    topAxis<span class="sy0">:</span> <span class="br0">&#91;</span><span class="br0">&#123;</span>
        dataIndex<span class="sy0">:</span>  <span class="st0">'year'</span><span class="sy0">,</span>
        header<span class="sy0">:</span>     <span class="st0">'Year'</span><span class="sy0">,</span>
        direction<span class="sy0">:</span>  <span class="st0">'ASC'</span>
    <span class="br0">&#125;</span><span class="br0">&#93;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;</pre>

<h3>Future</h3>
<p>Since mzPivotGrid is a commercial product, it will constantly be improved with new plugins and features. Feel free to contact us if you need something special implemented.</p>

<p>To learn more about mzPivotGrid licensing, click <a href="http://www.mzsolutions.eu/buy-mzPivotGrid.html
" target="_new">here</a>.</p>

<h3>Additional resources:</h3>
<ul>
<li><a href="http://www.mzsolutions.eu/mzPivotGrid-reports-and-custom-group-intervals.html" target="_new">Pivot grid example used in this article</a> </li>
<li><a href="http://www.mzsolutions.eu/mzPivotGrid.html" target="_new">Try some more mzPivotGrid examples </a></li>
<li><a href="http://www.mzsolutions.eu/docs/" target="_new">mzPivotGrid API docs</a></li>
</ul>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Fri, 29 Mar 2013 16:00 GMT</pubDate>
        <guid>http://www.sencha.com/blog/mzpivotgrid-a-pivot-table-for-ext-js/#date:16:00</guid>
        </item>
        
        <item>
        <title>Sencha.io Support in Sencha Cmd</title>
        <author>Matt Slevinsky</author>
        <description>
            Sencha.io is a backend-as-a-service, providing a set of APIs that helps developers to build and run their applications. Learn how to use the Sencha.io functionality available in Sencha Cmd by walking through the process of creating an application, deploying it to the cloud, and managing its settings.
        </description>
        <link>http://www.sencha.com/blog/sencha-io-support-in-sencha-cmd/</link>
        <content:encoded>
            <![CDATA[
                <h3>Introduction</h3>
<p><img src="http://cdn.sencha.io/img/20120607-whats-new-io.png" alt="sencha.io" width="120" class=" rounded shadow alignright">Sencha.io is a backend-as-a-service, providing a set of APIs that helps developers to build and run their applications. It enables you to build web applications using services provided through our mobile JavaScript framework Sencha Touch. Sencha Cmd is a command line tool that gives you access to a lot of functionality that is helpful when building applications with Sencha Touch including, as of version 3.1, Sencha.io support.</p>

<p>In this article, we will highlight the Sencha.io functionality available in Sencha Cmd by walking through the process of creating an application, deploying it to the cloud, and managing its settings.</p>

<h3>Getting Started &mdash; Hosting a Web App on Sencha.io</h3>
<p>To begin using the system, you will need a Sencha ID (same as your Sencha forum ID). If you don&rsquo;t already have one, visit the <a href="http://www.sencha.com/forum/register.php" target="_new">registration page</a> to get one. You&rsquo;ll also need a recent version of Sencha Cmd (version 3.1 or later). You can get a copy of Sencha Cmd for your specific OS platform from the official Sencha Cmd <a href=" http://www.sencha.com/products/sencha-cmd/download" target="_new">download page</a>.</p>

<p>For information about how to develop an application using the Sencha.io SDK and Sencha Touch, please visit the <a href="http://manage.sencha.io" target="_new">Sencha.io Dashboard</a>. You&rsquo;ll find downloads and examples of how to leverage the SDK in your own applications.</p>

<figure>
	<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-1.png" alt="Sencha Cmd and Sencha.io" width="636" class="rounded">
	<figcaption style="text-align:center;">The Sencha.io Dashboard</figcaption>
</figure>

</p>The Sencha.io Dashboard allows you to create and manage cloud hosting and services for your applications. While the Dashboard interface exposes the functionalities available in the Sencha.io platform, some developer workflows that include repetitive tasks are better suited to command line tools. To support these workflows, we have added Sencha.io support to Sencha Cmd which allows you to perform many of the same functions available in the Sencha.io Dashboard from the command line. For a brief overview of how to use Sencha Cmd, take a look at the Cmd <a href="http://docs.sencha.com/ext-js/4-2/#!/guide/command" target="_new">introduction guide</a>.</p>

<p>Let&rsquo;s start by creating an application that we can modify and configure. The following steps were executed in a command line window with access to a Sencha Cmd installation.</p>

<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-2.png" alt="Sencha Cmd and Sencha.io" width="636" class="rounded">

<p>In this example, test user extraordinaire Testy McTesterson is creating an app, called testApp. From the Sencha.io service response, you can see that the above service request was successful and a unique AppId and AppSecret has been created for this application to use. Since these values will be used in the client framework SDK to identify your application with the Sencha.io service, you may want to record them for future use. However, if you ever need them again, you can get them from the Sencha.io Dashboard or by using the Sencha.io <i>list-apps</i> command:</p>

<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-3.png" alt="Sencha Cmd and Sencha.io" width="636" class="rounded">

<p>When applications are deployed on Sencha.io, cloud hosting is automatically allocated for that app on Senchafy (Sencha.io&rsquo;s hosting service) and that app becomes available on the Internet at a unique Senchafy subdomain URL. You can see from the previous example that the output of the list-apps command includes the AppId and AppSecret, as well as this unique Senchafy URL for this specific app. Additionally, you can also register a CNAME for your app to use and assign it through the Sencha.io Dashboard.</p>

<p>Now that cloud hosting has been allocated for our app, we can create a version of that app and upload it to the cloud. Here, our test developer has prepared a small app that he wants to upload, in a zip file named app.zip, and use Cmd to upload it as version 1.0 of his app.</p>

<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-4.png" alt="Sencha Cmd and Sencha.io" width="636" class="rounded">

<p>Even though we&rsquo;ve successfully uploaded the application to the cloud, it must then be deployed in order to be accessible through its Senchafy URL. The deployment service allows you to keep multiple versions of your app stored in the system, and lets you switch between them as you see fit by deploying the appropriate app version. We will now execute the following command to deploy version 1.0 of our app that we just uploaded:</p>

<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-5.png" alt="Sencha Cmd and Sencha.io" width="636" class="rounded">

<p>Now the test app will be accessible through its <a href="http://b8tg6khg.senchafy.com" target="_new">Senchafy URL</a> and is now published in the cloud. Just to confirm that the application has been unpacked and deployed correctly, we can use the Sencha.io <i>io-fs</i> command to query and modify the file system of the remote application. To confirm that our index.html file inside app.zip has made it&rsquo;s way to the remote cloud file system, we can list all the files available:</p>

<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-6.png" alt="Sencha Cmd and Sencha.io" width="636" class="rounded">

<p>The above results confirm that the zip file containing index.html was successfully uploaded and added to the currently deployed app version. If you want to modify the contents of the currently deployed app version, you can use the Sencha.io <i>rm</i> and <i>put</i> commands to remove existing files and add new ones to the remote file system.</p>

<figure>
	<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-7.png" alt="Sencha Cmd and Sencha.io" width="636" class="rounded">
	<figcaption style="text-align:center;">The Todo List Application Hosted on Senchafy</figcaption>
</figure>

<h3>Configuring Authentication in Sencha.io</h3>
<p>One of the key features of Sencha.io is the user and authentication model. Users can log into the system either through an application specific username (email address) and password, or through their Facebook or Twitter accounts. Exactly which types of login are enabled for your application can be configured using the <a href="http://docs.sencha.io/current/index.html#!/guide/concepts_controller" target="_new">Authentication Groups settings</a> for your application. You can see a really good illustration of this concept in the Sencha.io Todo App example from the Sencha blog; I&rsquo;ve updated the code to work with the current version of Sencha.io, and I hosted it as the <a href="http://b8tg6khg.senchafy.com/" target="_new">test application</a> from the previous section.</p>

<p>To use Sencha.io Authentication Groups and User model, you first need to create an Authentication Group. Here our test developer is creating an auth group for the workers in his company:</p>

<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-8.png" alt="Sencha Cmd and Sencha.io" class="rounded">

<p>When an auth group is created, by default, it is enabled to use Sencha.io-based authentication (i.e, application specific username/email &amp; password). We can use Sencha Cmd to associate the Workers auth group that we just created with the test app we created earlier:</p>

<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-9.png" alt="Sencha Cmd and Sencha.io" width="636" class="rounded">

<p>Now, we can specify the login mechanisms for the app. For example, if we want to enable Facebook auth for testApp, we can do so from Sencha Cmd as well.</p>

<img src="http://cdn.sencha.io/img/20130317-sencha-cmd-io/cmd-io-10.png" alt="Sencha Cmd and Sencha.io" class="rounded">

<p>The developer needs to supply the application key and secret values for Facebook along with the above command, and the auth group will be updated. Now, any app which has the Workers auth group associated with it will accept Facebook logins, and any app built with the Controller from the client framework will automatically adjust its UI to this new auth group configuration.</p>

<h3>Summary</h3>
<p>Sencha Cmd allows you to perform a wide variety of tasks, including managing how an application is configured and hosted in Sencha.io. As the Sencha.io platform grows and more services and configuration options are added to it, we will continue to add equivalent features to Sencha Cmd, so developers can automate their workflows and test effectively. Let us know if you have any ideas for Cmd integration that will make your life easier and join the discussion on the <a href="http://www.sencha.com/forum/forumdisplay.php?95-io-Discussion" target="_new">Sencha.io forum</a>!</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Wed, 27 Mar 2013 16:00 GMT</pubDate>
        <guid>http://www.sencha.com/blog/sencha-io-support-in-sencha-cmd/#date:16:00</guid>
        </item>
        
        <item>
        <title>Creating Development Standards in the Enterprise</title>
        <author>Arthur Kay</author>
        <description>
            The Sencha Professional Services team works with many of our larger enterprise customers helping them to create, build and deploy incredible applications using Sencha products. Read about their recommendations for creating development standards to help customers define best practices and lower development time and costs.
        </description>
        <link>http://www.sencha.com/blog/creating-development-standards-in-the-enterprise/</link>
        <content:encoded>
            <![CDATA[
                <p>As a member of the Sencha Professional Services team, I spend most of my time directly interacting with our larger enterprise customers. Our team offers a wide variety of <a href="http://www.sencha.com/support/services" target="_new">expert services</a>, and in many cases, we spend weeks working side-by-side with a group of developers helping them to create, build and deploy incredible applications using Sencha products.</p>

<p>I recently had an opportunity to work with one of our enterprise clients, helping them define how Sencha should be used within their organization. I wanted to share some lessons and high-level concepts about enterprise architecture with the community that I think will benefit everyone.</p>

<img src="http://cdn.sencha.io/img/complete/20130311-complete-hero-small.png" alt="Sencha Complete" class="alignright">
<h3>Working with the Enterprise</h3>

<p>Working at the enterprise-level can be both very cool and very frustrating. On the one hand, I get to build really challenging apps; but on the other hand, enterprise applications often target legacy browsers and are prohibited from using cutting-edge technologies.</p>

<p>Having said that, I am starting to see many of our enterprise customers rethinking their development strategies and IT infrastructures: workstations are being upgraded to modern versions of Windows, and workers are being given more choices for a web browser. In some cases support for IE6 and IE7 are being dropped completely!</p>

<p>More importantly, I am noticing that enterprises are standardizing their development platforms to create an ecosystem of applications that can be maintained by a diverse team of developers. Because Sencha tools and frameworks are becoming the preferred development platform in this ecosystem, the Professional Services team has been helping our customers define their internal policies, training procedures and best practices in order to facilitate a transition to this new standard.</p>


<img src="http://cdn.sencha.io/img/20130317-development-enterprise/development-enterprise-1.png" alt="Why Development Standards Matter" width="300" class="alignright">
<h3>Why Development Standards Matter</h3>
<p>As a consultant, I constantly preach the benefits of having maintainable code:</p>

<ul>
<li>Applications are faster to produce</li>
<li>Applications are easier to debug</li>
<li>New features are easier to add</li>
<li>Code has fewer bugs</li>
<li>New developers can be trained quickly</li>
</ul>

<p>We all know that time equals money, so applications that take less time to create and maintain cost less money. Ultimately this makes managers, executives and shareholders happy. Because enterprise companies have many applications in production (both internal and external), it is critical that each member of the development team be able to jump onto any project in order to deliver on time and stay under budget.</p>

<p>Enterprise development teams often employ many developers distributed across large areas and contain a wide variety of skill sets. By standardizing the training, tools and best practices enterprises hope to decrease development time and costs while increasing the quality and lifespan of their applications.</p>

<img src="http://cdn.sencha.io/img/20130317-development-enterprise/development-enterprise-2.png" alt="Sencha as a Standard Platform" width="300" class="alignright">
<h3>Sencha as a Standard Platform</h3>

<p>When enterprises decide to make Sencha tools and frameworks a standard for application development, they&rsquo;re often communicating a need for consistency across their internal and external applications. This consistency usually includes both the UI (styling, widgets, functionality) and the underlying code (architecture, libraries, best practices).</p>

<p>Every company using Sencha tools and frameworks should consider creating a centralized repository of resources and best practices for their development teams. While the specifics of these resources might differ between companies, the following areas should be clearly documented to help developers get started and maintain consistency across projects.</p>

<h4>Developer Onboarding and Training</h4>
<p>In my experience working in an enterprise, it can be difficult to get the tools you need installed on your machine.</p>

<p>Most enterprise companies have a highly defined IT infrastructure, so new developers are forced to wait while all required hardware and software meets approval. This process can often take days to complete, and afterwards workers remain unsure how to request additional resources. In short, new developers lack access to a clear onboarding roadmap.</p>

<p>For Sencha customers, I recommend that a handful of onboarding procedures be clearly documented to lubricate this process:</p>

<ul>
<li>Required development tools</li>
<li>The process for requesting network credentials</li>
<li>Standard development workflows</li>
<li>How to access the Sencha forums and support portal</li>
<li>What Sencha training opportunities are recommended/offered</li>
</ul>

<p>It&rsquo;s important to remember that while developers don&rsquo;t need this information on a frequent basis they need to know how to access it.</p>


<img src="http://cdn.sencha.io/img/20130317-development-enterprise/development-enterprise-3.png" alt="Supported Platforms" width="200" class="alignright">
<h4>Supported Platforms</h4>
<p>One benefit of working in an enterprise is that developers usually know the exact specifications of the environments they need to support, but historically these environments have been troublesome for web applications.</p>

<p>As enterprises move forward with hardware and software upgrades, it is important that developers deliberately document their current list of supported environments. This list might include things like:</p>

<ul>
<li>Browsers (e.g. IE8, Firefox)</li>
<li>Operating Systems (e.g. Windows XP,7)</li>
<li>Devices (e.g. Lenovo ThinkPad)</li>
</ul>

<p>Having this knowledge clearly defined before starting new projects (and while maintaining legacy applications) helps to improve the accuracy of the delivered products. It also allows developers time to request any new hardware/software for testing.</p>

<blockquote class="pullquote"><p><span>&ldquo;</span>In some cases support for IE6 and IE7 are being dropped completely!</p>
</blockquote>

<p>On the other hand, this knowledge also helps to point out potential weaknesses. For example, the latest Firefox versions will auto-update themselves and support a wide variety of modern web standards; IE8 does not. Developers who understand those implications can avoid development practices that might collide with the defined supported platforms.</p>

<p>It is also important to document the specific products or platforms being used in the development process. This list might include:</p>

<ul>
<li>Frameworks (e.g. Ext JS 4.1.x, ASP.NET MVC 4)</li>
<li>3rd party libraries or components (e.g. other charting packages)</li>
<li>Supporting technologies (e.g. SASS)</li>
<li>Workarounds (e.g. using JSONP)</li>
</ul>

<p>This supplementary list is not only helpful in defining what products or platforms are required for development, but it can also define the skill sets necessary for employee acquisition and training.</p>

<h4>Internal Best Practices</h4>
<p>Development teams should also decide on a list of best practices, so all developers can contribute code without compromising maintainability.</p>

<p>The list of best practices can be short and high-level or long and detailed; the choice often depends on the size of your team and how the developer roles are organized.</p>

<p>For example, some <strong>high-level best practices</strong> might include:</p>

<ul>
<li>Overall architectural decisions (e.g. namespacing, file structure)</li>
<li>Security implementations</li>
<li>Error handling</li>
<li>Shared libraries and custom components (UX)</li>
<li>Documentation</li>
<li>Testing, builds and deployment</li>
</ul>

<p>...while some <strong>low-level best practices</strong> might include:</p>

<ul>
<li>Whitespace usage</li>
<li>Commit practices</li>
<li>Console usage</li>
<li>Browser Strict vs quirks mode</li>
</ul>

<p>In my experience, enforcing the low-level best practices is difficult to do without mandatory code reviews. While code reviews are a fantastic way to teach junior developers, maintain code quality and stimulate creativity, it&rsquo;s not something typically done in most enterprises.</p>

<h3>What are your thoughts?</h3>
<p>This article highlights some ideas for implementing development standards in large organizations but is far from a comprehensive plan. The Sencha <a href="http://www.sencha.com/support/services" ="_new">Professional Services</a> team provides a variety of services including high-level architectural reviews, deep analysis of application performance, custom UX development and everything in-between, and we can tailor an engagement to fit each customer&rsquo;s specific needs. The concepts above are a good start and should translate easily into any business.</p>

<p>If your company has implemented a set of development standards, please share your thoughts and experiences!</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Mon, 25 Mar 2013 13:11 GMT</pubDate>
        <guid>http://www.sencha.com/blog/creating-development-standards-in-the-enterprise/#date:13:11</guid>
        </item>
        
        <item>
        <title>Sencha Architect 2.2: Better, Faster, Stronger</title>
        <author>Gil Gordon</author>
        <description>
            Yesterday, we announced new versions of Sencha Architect and Ext JS. We gave a brief summary of Architect 2.2 new features in our Sencha March Madness blog post, and today we want to dive deeper into all of the improvements we&amp;rsquo;ve made over the last few months.
        </description>
        <link>http://www.sencha.com/blog/sencha-architect-2-2-better-faster-stronger/</link>
        <content:encoded>
            <![CDATA[
                <p><img src="http://cdn.sencha.io/img/architect/20130311-architect-hero.png" alt="Sencha Architect 2.2" width="636" class="aligncenter"></p>

<p>Yesterday, we announced new versions of Sencha Architect and Ext JS. We gave a brief summary of Architect 2.2 new features in our <a href="http://www.sencha.com/blog/sencha-march-madness/" target="_new">Sencha March Madness blog post</a>, and today we want to dive deeper into all of the improvements we&rsquo;ve made over the last few months.</p>

<p>As Architect matures, we find many developers using it to develop large projects &mdash; frequently in collaboration with other developers. As these projects grow in complexity, developers face new challenges in managing them. Architect 2.2 is squarely focused on improving the experience for these users &mdash; in everything from Architect's raw performance, to ease of navigation, to better source control integration, and new features to make development easier.</p>

<p>The first thing we did was improve Architect's performance by using the newest version of <a href="http://www.sencha.com/products/desktop-packager/" target="_new">Sencha Desktop Packager</a> to package Architect. This brought significant improvements in memory footprint and performance. When opening real-world sample projects we are seeing Architect use only a quarter to a third as much memory as it used to. (For those who don't know: Architect is built with Ext JS, and this newest version replaces an older packaging technology with our own modern and fast Desktop Packager. We think Architect 2.2 is a pretty good demonstration of what can be accomplished with the Sencha frameworks and the packager. Eating our own dogfood and turtles all the way down &mdash; with great payoff in performance.) </p>

<h3>Open and Save Projects Faster Than Ever</h3>
<p>We also changed the way Architect opens and saves projects and files to get more performance improvements. When opening a project in Architect 2.2, only the project components that are selected are opened &mdash; making it much faster to open large projects. We were pleasantly surprised to see a full order of magnitude improvement in project load time: projects that used to take 30 to 50 seconds to open now open in 3 to 5 seconds.</p>

<p><a href="http://cdn.sencha.io/img/20130314-sencha-architect-2-2/architect-1.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130314-sencha-architect-2-2/architect-1.png" alt="Sencha Architect 2.2 Performance Numbers" width="450" style="border: 1px solid #d8d8d8;" class="aligncenter"></a></p>

<p>Now that Architect is only opening project components as needed, we also made it more efficient when saving a project. Now when you click "Save", Architect only saves out metadata and application files that have been modified, making this much faster, especially if you are a frequent saver. Of course, there will still be times when you want to regenerate the entire application, and the "Build" button does exactly that.</p>

<h3>Intelligent Source Control Integration</h3>
<p>More efficient saving also improves integration with source control, as you are no longer changing all the generated application code each time you save a small change. We did one more thing to help with source control integration. We not only made Architect aware of file changes on disk, but also made sure Architect is able to handle those changes intelligently. Architect now watches your project folder so that it notices when items are changed by anything other than Architect itself (e.g., by your source control system). If the change detected is made to a component that isn't currently open, but is modified in Architect, Architect simply accepts the change and notes it in the log files. If the detected change is in a component that the developer is actively editing, Architect alerts the developer and lets them decide whether to keep the version detected on disk or the changes they are working on in Architect. This makes it much easier to collaborate with other Architect users on the same project without stepping on each other&rsquo;s toes. </p>

<h3>Improved Project Navigation</h3>
<p>Performance and source control improvements are helpful, but if you have a massive project it is still hard to keep track of all your components. To help you find them we added a "Quick Open..." search box in the Project Inspector which helps you easily find and open top level components. </p>

<p>Once you've found your component, you often need to switch back and forth between different components, for example between the canvas layout of a view component and the related function code in a controller. To make this easier, Architect now allows you to open multiple tabs in the Canvas. You can open and then easily switch between the tabs using keyboard shortcuts.</p>

<p><img src="http://cdn.sencha.io/img/20130313-march-madness/march-madness-1.png" alt="Sencha Architect 2.2 Tabs" class="aligncenter rounded shadow"></p>

<h3>Easier Coding</h3>
<p>We&rsquo;ve also learned that as Architect projects get bigger and more complicated, developers sometimes have to create custom overrides to accomplish their goals. We&rsquo;ve made a change in in Architect 2.2 that will improve these situations. One of the scenarios that often generated overrides was bringing in external code into Architect (e.g., third-party JavaScript components or extensions). In Architect 2.2, you can add your component as a JavaScript resource and specify the alias to create it using Architect&rsquo;s new CreateAlias and CreateClass configs.</p>

<p>Additionally, when a component starts its lifecycle, it&rsquo;s now easier to insert your custom behavior code using the new processConfig (Ext JS) or initialize (Touch) configs in Architect. There is more information about this new functionality in the <a href="http://docs.sencha.com/architect/2/#!/guide/config_panel-section-8" target="_new">Architect</a> docs.</p>

<h3>Are You Mocking Me?</h3>
<p>Architect already makes it easy to get store data from varied data sources, but sometimes it can be hard to get valid source data to Architect during development, which makes developing an application&rsquo;s user interface hard. For example, the backend store might require an authentication token or geo-location data to provide useful information. Architect now allows the developer to enter mock data for a store&rsquo;s data config. This mock data is displayed inside the Architect canvas in views that consume the store, but when you ship your app you don&rsquo;t want to ship the mock data, so Architect does not include it in the code it generates.</p>

<p><a href="http://cdn.sencha.io/img/20130314-sencha-architect-2-2/architect-2.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130314-sencha-architect-2-2/architect-2.png" alt="Sencha Architect 2.2 Mock Data" width="636" class="aligncenter rounded shadow"></a></p>

<h3>Deep Support and Tight Integration for Latest Frameworks </h3>
<p>Last, but by no means least, Architect now supports the latest releases of the Sencha frameworks. If you are as excited as us about the new Neptune theme, big data grids, and Right-to-Left (RTL) support in Ext JS 4.2, then you'll love how easy it is to work with Ext JS 4.2 in Architect 2.2. If you started your Architect project in an older version of the framework, then don&rsquo;t worry. Architect will happily take care of all the details of upgrading to Ext JS 4.2. </p>

<object width="600" height="338"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=59693140&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=59693140&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="338"></embed></object><br/><br/>

<p><a href="http://cdn.sencha.io/img/20130314-sencha-architect-2-2/architect-3.png" class="nth-1 lightbox"><img src="http://cdn.sencha.io/img/20130314-sencha-architect-2-2/architect-3.png" alt="Sencha Architect 2.2 RTL" width="636" class="aligncenter rounded shadow"></a></p>

<p>That wraps up all the major new improvements we&rsquo;ve made to Architect 2.2. Stay tuned for an upcoming blog post about the Ext JS 4.2 changes, and then try them out in Architect 2.2 &mdash; it&rsquo;s a great way to see the new functionality in the framework. </p>

<p>You can <a href="http://www.sencha.com/products/architect/download" target="_new">download</a> Architect 2.2 today, either to <a href="https://www.sencha.com/store/architect/" target="_new">buy</a> or as a 30 day trial. Architect is also a part of <a href="http://www.sencha.com/products/complete" target="_new">Sencha Complete</a> and the new <a href="http://www.sencha.com/products/touch-bundle" target="_new">Sencha Touch Bundle</a>. For existing users we will start pushing auto updates in about a week. </p>

<p>Lastly, we've reset expired Architect evaluations and extended existing Architect evaluations for an additional 30 days. To re-activate Architect, simply select "change user" in the Architect splash screen and enter your user credentials.</p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Thu, 14 Mar 2013 18:21 GMT</pubDate>
        <guid>http://www.sencha.com/blog/sencha-architect-2-2-better-faster-stronger/#date:18:21</guid>
        </item>
        
        <item>
        <title>Sencha March Madness</title>
        <author>Aditya Bansod</author>
        <description>
            It’s not everyday we release two product updates and launch a new bundle in one fell swoop, but today is not an ordinary day. We’re very excited to announce the release of Sencha Architect 2.2, Sencha Ext JS 4.2, and the new Sencha Touch Bundle.
        </description>
        <link>http://www.sencha.com/blog/sencha-march-madness/</link>
        <content:encoded>
            <![CDATA[
                <p>It&rsquo;s not everyday we release two product updates and launch a new bundle in one fell swoop, but today is not an ordinary day. We&rsquo;re very excited to announce the release of Sencha Architect 2.2, Sencha Ext JS 4.2, and the new Sencha Touch Bundle.</p>


<p>If there&rsquo;s a common theme across all three of these announcements, it is developer productivity. Today&rsquo;s releases make things faster, easier, and more convenient for developers. The new Sencha Touch Bundle brings all of our mobile development technologies together in a convenient and cost-effective package. The many new features in Architect 2.2 and Ext JS 4.2 range from better team capabilities in Architect to Internet Explorer 10 support and the Neptune theme in Ext JS. And better yet, they all work well together, letting you easily use these new Ext JS features from within Architect. </p>

<p>You can get a great introduction to the new releases in this video, where a few of our engineers and product managers talk about it in their own words.</p> 

<object width="600" height="337"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=61653688&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=61653688&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="337"></embed></object><br/><br/>

We also cover all of the details of each product below, and you can look forward to a few follow-up blog posts in the coming week that will go even deeper on specific features and functionality.</p>

<hr>

<h3>Sencha Architect 2.2</h3>

<p><img src="http://cdn.sencha.io/img/architect/20130311-architect-hero.png" alt="Sencha Architect" width="600" class="aligncenter"></p>

<p>Larger and larger projects are getting built in <a href="/products/architect/">Sencha Architect</a> with multiple developers working on the same project and in Architect 2.2, that&rsquo;s exactly what we focused on: improving the experience for developers working on large projects and in multi-person teams.</p>

<ul>
	<li>We start off with massive performance improvements. We upgraded the platform of Architect to our own Sencha Desktop Packager 1.1, resulting in a significant performance improvement. Additionally, Architect now selectively loads components as the developer opens them, instead of opening all project components at once. These changes reduce Architect&rsquo;s memory footprint on real world projects by 60% to 80%, and speeds up project load times for large projects by an order of magnitude. </li><br/>

	<li>To enable better integration with source control systems Architect now watches the developer&rsquo;s file system for changes to project files that happen when synchronizing changes from other developers. When changes are detected, Architect handles all the updates to the underlying files seamlessly. If a collision happens, we now prompt the user about how to proceed.</li><br/>

	<li>As projects grow in complexity, it can be hard to keep track of all the components and to navigate around the project. Architect 2.2 adds multiple tab support to the canvas enabling easy switching between components. There&rsquo;s a new Quick Open feature to make it easy to find and open a component in your project &mdash; which is a major time saving on the business-scale projects being built in Architect.</li><br/>

	<p><img src="http://cdn.sencha.io/img/20130313-march-madness/march-madness-1.png" alt="Quick Open Feature and Tabs" class="rounded shadow"></p>

	<li>After making Architect faster, easier to navigate, and easier for teams to use, we also made it easier to write great apps with improvements for bringing in external libraries, inserting custom code into components, and mocking up data for stores. Many applications use other libraries with the Sencha frameworks, and Architect 2.2 allows simpler integration of these external JavaScript libraries without using code overrides by using createAlias and createClass configs to set up an xtype or class name for the external component. Additionally, when a component starts its lifecycle, it&rsquo;s now easier to insert your custom behavior code using the new processConfig (Ext JS) or initialize (Touch) configs in Architect.
<br><br>
If you have been using custom overrides before, this new method makes it easier to keep the application more streamlined and uses frameworks best practices. Lastly, for many applications, it is not easy during development to get good data from their store(s), for example the store may require geolocation information, or a user-specific authentication token. Architect 2.2 now supports mock-up data in a store&rsquo;s Data config. This mock data is available to render in canvas views, but is not included in the final code that Architect generates, making it both easier and safer to design your application.</li><br>

	<li>And of course Architect 2.2 supports the latest released frameworks and all their features, about which you can read more below. Architect 2.2 makes it easy to get all the new framework goodness by upgrading existing projects to Ext JS 4.2 with just a couple of mouse clicks.</li> 
	<p><img src="http://cdn.sencha.io/img/20130313-march-madness/march-madness-2.png" alt="Upgrade" class="rounded shadow"></p>
	<!--<mini screen-shot of upgrade menu here?&gt;--> 
</ul>

<hr>

<h3>Sencha Ext JS 4.2</h3>
<img src="http://cdn.sencha.io/img/extjs/20130311-ext-js-hero-1.png" alt="Sencha Ext JS" width="636" class="aligncenter">

<p>For the release of <a href="/products/extjs/">Sencha Ext JS 4.2</a>, we&rsquo;ve been working on some of the most demanded features from our customers and community, in addition to working on general stability, bugs, and performance improvements. For the full list of what&rsquo;s new and changed, please check out the Release Notes.</p>

<ul>

	<li><strong>Big data grids</strong>: we&rsquo;ve done a major overhaul of the bufferedrenderer in Ext JS 4.2 in order to support enterprise developers who are building high data point applications. Applications such as financial or insurance applications can take advantage of these new capabilities to show much larger data sets across a large variety of browsers. To see how dramatic the changes are, check out this video walkthrough. </li><br/>

	<object width="600" height="338"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=59611158&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=59611158&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="338"></embed></object><br/><br/>


	<li><strong>Neptune theme</strong>: The long awaited Neptune theme is finally here! Neptune gives developers a light and clean, fully modern UI with even more powerful customization capabilities. We&rsquo;ve restructured how themes are built in Ext JS to be more flexible and integrated theme packaging with Cmd so it&rsquo;s easy to share and also easy to minify themes. Pictures speak a thousand words, so check out any of the Ext JS demos, which now have Neptune enabled by default, but give you a convenient way to switch to the classic, grey and accessibility themes. </li><br/>

	<object width="600" height="338"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=59693140&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=59693140&amp;force_embed=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="600" height="338"></embed></object><br/><br/>	

	<li><strong>Right-to-left support</strong>: if you&rsquo;re a developer who has requirements to build applications for the Middle East or East Asia, the new support for right-to-left in Ext JS 4.2 will make your life significantly easier. We&rsquo;ve enabled it as an optional package so the framework doesn&rsquo;t carry extra weight for this support, but if you need it, it&rsquo;s right there for you to enable it.</li><br/>

	<li><strong>IE10 support</strong>: Ext JS 4.2 now fully supports Internet Explorer 10, ensuring your applications have uninterrupted application compatibility as IE10 shows up in more businesses. (note: we&rsquo;re also actively working on a patch for Ext JS 3.4 to add IE10 support, so stay tuned).</li>
</ul>

<hr>

<h3>Sencha Touch Bundle</h3>

<p><img src="http://cdn.sencha.io/img/touch-bundle/Touch-Bundle-Hero-Web.png" alt="Sencha Touch Bundle" class="aligncenter"></p>

<p>Sencha Touch has continued its amazing trajectory, and Touch adoption has continued to grow rapidly. In parallel with our constant improvements to Touch, we&rsquo;ve been steadily building out a rich set of premium mobile development tools to help developers be very productive and efficient building apps with Touch &mdash; but we&rsquo;ve left it up to developers to find and buy these, as well as technical support, individually. Today, we&rsquo;re rolling out the <a href="/products/touch-bundle/">Sencha Touch Bundle</a>, to bring all of that together and make it easy for customers to buy a single package of mobile development tools, components, and business-grade support. </p>

<p>The Touch Bundle includes Sencha Touch, Sencha Touch Charts, Sencha Architect, Sencha Eclipse Plugin, plus business-grade support and maintenance for all the products. We&rsquo;re making it available today at a special introductory price of $695 ($100 off of list price). If you&rsquo;re a serious mobile developer who wants the best possible toolset with full support, this is a great deal.</p>

<hr>

<h3>Sencha Touch 2.2 (Beta)</h3>

<p>We're also using today to call attention to Sencha Touch 2.2, which is currently in beta.  Touch 2.2 brings you powerful new components, support for Windows Phone 8 and IE10, significant performance enhancements, and more. We're still working on additional betas and would love your feedback, so we invite you to check out the beta <a href="http://www.sencha.com/forum/announcement.php?f=91&a=36" target="_new">here</a>.</p>

<hr>

<h3>Final Thoughts </h3>
<p>Ext JS 4.2 delivers on our previous commitment to deliver a modern theme as well as RTL in the Ext JS 4 product train. We are still actively working on accessibility, which is the final remaining product commitment that we made for Ext JS 4. </p>

<p>Also, we wanted to give special thanks to our beta testers, who downloaded and tried early builds of these products, and gave us very valuable feedback. These releases are much stronger thanks to your help. We love your support and we&rsquo;re excited to release these products to you and to the broader Sencha community.</p>

<p>Finally, <a href="/products/architect/">Sencha Architect 2.2</a>, <a href="/products/extjs/">Sencha Ext JS 4.2</a>, and the new <a href="/products/touch-bundle">Sencha Touch Bundle</a> are all available for download and purchase today. Please give them a try and let us know what you think! </p>
                <style>
                    .right, .alignright { float: right; margin: 0 0 10px 10px; }
                    .left, .alignleft { float: left; margin: 0 10px 10px 0; }
                </style>
            ]]>
        </content:encoded>
        <pubDate>Wed, 13 Mar 2013 02:23 GMT</pubDate>
        <guid>http://www.sencha.com/blog/sencha-march-madness/#date:02:23</guid>
        </item>
        
    </channel>
</rss>
