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

<channel>
	<title>SwarmOnline Web Design</title>
	<atom:link href="http://www.swarmonline.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.swarmonline.com</link>
	<description>Web Design &#38; Development Services Scotland</description>
	<lastBuildDate>Sat, 31 Dec 2011 15:13:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ext.ux.TouchCalendar &#8211; A Sencha Touch Calendar component</title>
		<link>http://www.swarmonline.com/2011/11/ext-ux-touchcalendar/</link>
		<comments>http://www.swarmonline.com/2011/11/ext-ux-touchcalendar/#comments</comments>
		<pubDate>Sun, 20 Nov 2011 19:38:35 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Sencha Touch]]></category>
		<category><![CDATA[Sencha Touch Extensions & Plugins]]></category>
		<category><![CDATA[Web Design & Development Blog]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=1367</guid>
		<description><![CDATA[Overview Ext.ux.TouchCalendar is an extension and series of related plugins that allow a calendar component to be integrated into Sencha<a href="http://www.swarmonline.com/2011/11/ext-ux-touchcalendar/">(more...)</a>]]></description>
			<content:encoded><![CDATA[<h1><span class="Apple-style-span" style="font-size: 20px;">Overview</span></h1>
<p>Ext.ux.TouchCalendar is an extension and series of related plugins that allow a calendar component to be integrated into Sencha Touch applications.</p>
<p>Links to the repository, documentation and demos (along with some inline demos) can be found further down this post.<br />
<span id="more-1367"></span></p>
<h2>Download</h2>
<p>The extension can be downloaded from our GitHub repository - <a href="https://github.com/SwarmOnline/Ext.ux.TouchCalendar" target="_blank">https://github.com/SwarmOnline/Ext.ux.TouchCalendar</a></p>
<h2>Features</h2>
<p><strong>Ext.ux.TouchCalendar/Ext.ux.TouchCalendarView</strong><br />
<a href="http://www.swarmonline.com/wp-content/uploads/2011/11/Ext.ux_.TouchCalendarView-month-ss1.png"><img class="size-thumbnail wp-image-1378 alignleft" style="border-style: initial; border-color: initial;" title="Ext.ux.TouchCalendarView" src="http://www.swarmonline.com/wp-content/uploads/2011/11/Ext.ux_.TouchCalendarView-month-ss1-150x150.png" alt="" width="150" height="150" /></a></p>
<ul style="margin-left: 180px;">
<li>Month, Week and Day views</li>
<li>Gesture support to change current period</li>
<li>Time slot (day or time interval) selection</li>
</ul>
<div>
<div style="clear: both;"><strong>Ext.ux.TouchCalendarEvents</strong></div>
<div><a href="http://www.swarmonline.com/wp-content/uploads/2011/11/Ext.ux_.TouchCalendarEvents-month-ss.png"><img class="alignleft size-thumbnail wp-image-1384" title="Ext.ux.TouchCalendarEvents" src="http://www.swarmonline.com/wp-content/uploads/2011/11/Ext.ux_.TouchCalendarEvents-month-ss-150x150.png" alt="" width="150" height="150" /></a></div>
<div>
<ul style="margin-left: 180px; margin-top: 20px;">
<li>Bind a data store to the calendar to display Event Bars</li>
<li>Drag and Drop event moving</li>
</ul>
<div style="clear: both;"><strong>Ext.ux.TouchCalendarSimpleEvents</strong></div>
<div><a href="http://www.swarmonline.com/wp-content/uploads/2011/11/Ext.ux_.TouchCalendarSimpleEvents-month-ss.png"><img class="alignleft size-thumbnail wp-image-1386" title="Ext.ux.TouchCalendarSimpleEvents" src="http://www.swarmonline.com/wp-content/uploads/2011/11/Ext.ux_.TouchCalendarSimpleEvents-month-ss-150x150.png" alt="" width="150" height="150" /></a></div>
<div>
<ul style="margin-left: 180px; margin-top: 20px;">
<li>Bind a data store to the calendar to display &#8216;dots&#8217; on days with events</li>
</ul>
</div>
</div>
<h2></h2>
<h2></h2>
<h2></h2>
<h2>Documentation</h2>
<p><a href="http://www.swarmonline.com/Ext.us.TouchCalendar/docs"><img class="aligncenter size-full wp-image-1416" title="Ext.ux.TouchCalendar Docs" src="http://www.swarmonline.com/wp-content/uploads/2011/11/Ext.ux_.TouchCalendar-docs.png" alt="" width="663" height="242" /></a></p>
<p>Please go to <a title="Ext.ux.TouchCalendar Documentation" href="http://www.swarmonline.com/Ext.ux.TouchCalendar/docs" target="_blank">swarmonline.com/</a><a title="Ext.ux.TouchCalendar Documentation" href="http://www.swarmonline.com/Ext.ux.TouchCalendar/docs" target="_blank">Ext.ux.TouchCalendar/docs</a> for full documentation of this extension and its plugins. You will find it under the &#8216;ux&#8217; namspace folder.</p>
<p>A big thanks to the Rene Saarsoo (@nene) and the other guys at Sencha for their work on <a title="JSDuck" href="https://github.com/senchalabs/jsduck" target="_blank">JSDuck</a>!</p>
<h2>Demos</h2>
<p>You can try out the extension live inside the following iPhone graphics or you can view the various other demos using the links below. All of these demos can be found in the &#8216;examples&#8217; directory of the project.</p>
<div class="non-webkit-warning box_info">You are currently not using a WebKit browser. Please reopen this page in <a href="http://www.google.co.uk/chrome">Google Chrome</a> or <a href="http://www.apple.com/safari/">Safari</a> to get the full experience.</div><script>if(jQuery.browser.webkit){ jQuery('.non-webkit-warning').hide(); }</script><div style="position: absolute; left: 50%; margin-left: -221px; background-image: url('http://www.swarmonline.com/wp-content/plugins/SenchaTouchDemo/iPhone.png'); height: 790px; width: 441px;"></div><iframe src="http://www.swarmonline.com/Ext.ux.TouchCalendar/examples/Ext.ux.TouchCalendarView.html" style="position: relative; left: 50%; margin-top: 173px; margin-left: -159px;" width="320px" height="480px"><p>Your browser does not support iframes.</p></iframe><br/><br/><br/><br/><br/><br/><br/><br/><br/><div class="clear"></div><br/><br/><br/>
<div class="non-webkit-warning box_info">You are currently not using a WebKit browser. Please reopen this page in <a href="http://www.google.co.uk/chrome">Google Chrome</a> or <a href="http://www.apple.com/safari/">Safari</a> to get the full experience.</div><script>if(jQuery.browser.webkit){ jQuery('.non-webkit-warning').hide(); }</script><div style="position: absolute; left: 50%; margin-left: -221px; background-image: url('http://www.swarmonline.com/wp-content/plugins/SenchaTouchDemo/iPhone.png'); height: 790px; width: 441px;"></div><iframe src="http://www.swarmonline.com/Ext.ux.TouchCalendar/examples/Ext.ux.TouchCalendarEvents.html" style="position: relative; left: 50%; margin-top: 173px; margin-left: -159px;" width="320px" height="480px"><p>Your browser does not support iframes.</p></iframe><br/><br/><br/><br/><br/><br/><br/><br/><br/><div class="clear"></div><br/><br/><br/>
<div class="non-webkit-warning box_info">You are currently not using a WebKit browser. Please reopen this page in <a href="http://www.google.co.uk/chrome">Google Chrome</a> or <a href="http://www.apple.com/safari/">Safari</a> to get the full experience.</div><script>if(jQuery.browser.webkit){ jQuery('.non-webkit-warning').hide(); }</script><div style="position: absolute; left: 50%; margin-left: -221px; background-image: url('http://www.swarmonline.com/wp-content/plugins/SenchaTouchDemo/iPhone.png'); height: 790px; width: 441px;"></div><iframe src="http://www.swarmonline.com/Ext.ux.TouchCalendar/examples/Ext.ux.TouchCalendar.html" style="position: relative; left: 50%; margin-top: 173px; margin-left: -159px;" width="320px" height="480px"><p>Your browser does not support iframes.</p></iframe><br/><br/><br/><br/><br/><br/><br/><br/><br/><div class="clear"></div><br/><br/><br/>
<h2>Issues or Suggestions?</h2>
<p>As this is a first release we anticipate a few issues cropping up so please open an Issue on the GitHub repository and we&#8217;ll get onto it as soon as possible!</p>
<p style="text-align: center;">
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/11/ext-ux-touchcalendar/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Announcing: Sencha Ext JS 4 Web Application Development Cookbook</title>
		<link>http://www.swarmonline.com/2011/10/announcing-sencha-ext-js-4-web-application-development-cookbook/</link>
		<comments>http://www.swarmonline.com/2011/10/announcing-sencha-ext-js-4-web-application-development-cookbook/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 18:44:43 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Web Design & Development Blog]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=1326</guid>
		<description><![CDATA[We are delighted to officially announce that the Ext JS 4 Web Application Development Cookbook is now available for pre-order from<a href="http://www.swarmonline.com/2011/10/announcing-sencha-ext-js-4-web-application-development-cookbook/">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">We are delighted to officially announce that the <strong><a title="Ext JS 4 Web Application Development Cookbook" href="http://www.packtpub.com/sencha-ext-js-4-web-application-development-cookbook/book" target="_blank">Ext JS 4 Web Application Development Cookbook</a></strong> is now available for pre-order from <a href="http://www.packtpub.com/sencha-ext-js-4-web-application-development-cookbook/book" target="_blank">Packt Publishing</a>.</p>
<p style="text-align: justify;">Packed with over 130 easy to follow recipes which demonstrate, through real life examples, numerous features of Ext JS 4. This book will help you create anything from basic components to advanced web applications using Sencha&#8217;s unrivalled Ext JS framework.</p>
<p><span id="more-1326"></span></p>
<p style="text-align: justify;"><a href="http://www.packtpub.com/sencha-ext-js-4-web-application-development-cookbook/book" target="_blank"><img class="alignright size-medium wp-image-1330" title="Ext JS 4 Cookbook Cover" src="http://www.swarmonline.com/wp-content/uploads/2011/10/6860OS_mockupcover_cb-243x300.jpg" alt="Ext JS 4 Web Application Development Cookbook" width="243" height="300" /></a><strong>Ext JS 4</strong> is Sencha’s latest JavaScript framework for developing cross-platform web applications. Built upon web standards, Ext JS provides a comprehensive library of user interface widgets and data manipulation classes to turbo-charge your application’s development. Ext JS 4 builds on Ext JS 3, introducing a number of new widgets and features including the popular MVC architecture, easily customisable themes and plugin-free charting.</p>
<p style="text-align: justify;"><em>Ext JS 4 Web Application Development Cookbook</em> works through the framework from the fundamentals to advanced features and application design. More than 130 detailed and practical recipes demonstrate all of the key widgets and features the framework has to offer. With this book, and the Ext JS framework, learn how to develop truly interactive and responsive web applications.</p>
<p style="text-align: justify;">Starting with the framework fundamentals, you will work through all of the widgets and features the framework has to offer, finishing with extensive coverage of application design and code structure.</p>
<p style="text-align: justify;">Over 130 practical and detailed recipes describe how to create and work with forms, grids, data views, and charts. You will also learn about the best practices for structuring and designing your application and how to deal with storing and manipulating data. The cookbook structure is such that you may read the recipes in any order.</p>
<p style="text-align: justify;">The <em>Ext JS 4 Web Application Development Cookbook</em> will provide you with the knowledge to create interactive and responsive web applications, using real life examples.</p>
<p style="text-align: justify;"><strong>What you will learn from this book :</strong></p>
<ul>
<li style="text-align: justify;">Structure your application according to best practices, manipulate the DOM, and handle events raised by users and the framework</li>
<li style="text-align: justify;">Learn the layouts available in Ext JS and understand how to combine these to make complex layouts</li>
<li style="text-align: justify;">Create aesthetic and user-friendly forms, validate these on the client, and submit data to your server</li>
<li style="text-align: justify;">Present and organize data with Trees, Tabbed layouts, Data Views, and Templates</li>
<li style="text-align: justify;">Make AJAX requests, model data objects, incorporate Ext.Direct, perform CRUD operations on data, and integrate HTML5 local storage with Ext JS</li>
<li style="text-align: justify;">Work with Grids to present and manipulate tabular data by editing rows, dragging and dropping records, scrolling infinitely, and grouping data</li>
<li style="text-align: justify;">Represent data visually with flexible and interactive Charts and Drawing components</li>
<li style="text-align: justify;">Customize the look and feel of your application with SASS and Compass</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/10/announcing-sencha-ext-js-4-web-application-development-cookbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Sencha Touch Forms : Part 3 : Adding form fields on the fly</title>
		<link>http://www.swarmonline.com/2011/05/dynamic-sencha-touch-forms-part-3-adding-form-fields-on-the-fly/</link>
		<comments>http://www.swarmonline.com/2011/05/dynamic-sencha-touch-forms-part-3-adding-form-fields-on-the-fly/#comments</comments>
		<pubDate>Mon, 30 May 2011 12:48:36 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Sencha Touch]]></category>
		<category><![CDATA[Web Design & Development Blog]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=1293</guid>
		<description><![CDATA[After a comment from Brandon looking for advice on adding form fields on the fly, I thought it would be<a href="http://www.swarmonline.com/2011/05/dynamic-sencha-touch-forms-part-3-adding-form-fields-on-the-fly/">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>After a comment from Brandon looking for advice on adding form fields on the fly, I thought it would be worth a mini blog article to explain it.</p>
<p>What we want to do is add a button to our form that, when tapped, will add a new field to the form. By adding this functionality we can allow users to enter arbitrary amounts of data. This can be applied to situations such as, when entering ingredients for a recipe (we don&#8217;t want to restrict them to a set number, nor do we want to prepopulate the form with too many fields); adding qualifications to your CV (not everyone has the same number of qualifications so how do we allow them to enter the right number?).</p>
<p><span id="more-1293"></span></p>
<p>So, you get the idea about why we might want this &#8211; but how do we make it?</p>
<p>As with all our tutorials there is a <a href="http://www.swarmonline.com/wp-content/plugins/download-monitor/download.php?id=8">Tutorial Package</a> that contains all the files you need to try the examples and follow the tutorial step by step. If you click on the Step&#8217;s header you can view the demo for that step.</p>
<div class="box_download"><a href="http://www.swarmonline.com/wp-content/plugins/download-monitor/download.php?id=9">Dynamic Sencha Touch Forms - Part 3 - Tutorial Package</a></p>
<p>Just drop into the Sencha Touch &#8216;examples&#8217; directory</div>
<div class="box_info"><a title="Final Result" href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles1.1/Demos/Dynamic%20Sencha%20Touch%20Forms%20-%20Part%203/Step%202%20-%20Make%20it%20Dynamic.html">View the Final Result</a></div>
<h2><a title="Step 1 - Create our Form" href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles1.1/Demos/Dynamic%20Sencha%20Touch%20Forms%20-%20Part%203/Step%201%20-%20Create%20our%20Form.html" target="_blank">Step 1 &#8211; Create our Form</a></h2>
<p>As in the previous parts we&#8217;re going to create a basic form to house our dynamic fields. This is a simple form (with no fields) with an Add button docked to the top and a Submit button docked to the bottom.</p>
<pre class="brush: jscript; title: ; notranslate">

Ext.ns('DynamicForms'); // register our namespace
DynamicForms.MyForm = Ext.extend(Ext.form.FormPanel, {

    initComponent: function(){

        Ext.apply(this, {
            floating: true,
            width: 350,
            height: 370,
            centered: true,
            modal: true,
            hideOnMaskTap: false,
            scroll: 'vertical',
            dockedItems: [{
                dock: 'top',
                xtype: 'button',
                text: 'Add Field',
                handler: function(){
                    // handler to be completed in Step 2
                },
                scope: this
            }, {
                dock: 'bottom',
                xtype: 'button',
                text: 'Submit',
                handler: function(){
                    // handler to be completed in Step 2
                },
                scope: this
            }],
            items: []
        });

        DynamicForms.MyForm.superclass.initComponent.call(this);
    }

});
</pre>
<p>We have left our buttons&#8217; handlers empty just now, but we will add in that functionality in Step 2.</p>
<h2><a title="Step 2 - Make it Dynamic" href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles1.1/Demos/Dynamic%20Sencha%20Touch%20Forms%20-%20Part%203/Step%202%20-%20Make%20it%20Dynamic.html" target="_blank">Step 2 &#8211; Make it Dynamic</a></h2>
<p>Now we add the fun stuff. What we want to do is, when the Add button is tapped, create a new TextField and add it to the Form. This is remarkably simple and requires a whopping two lines of code. So we add this code to the Add button&#8217;s handler.</p>
<pre class="brush: jscript; title: ; notranslate">

this.add({
    xtype: 'textfield',
    name: 'MyField-' + this.items.length
});

this.doLayout();
</pre>
<p>We use the Form&#8217;s &#8216;<strong>add</strong>&#8216; method to create the new TextField and just pass it a configuration option that will create the field (I&#8217;ve only used a couple of config options to show the idea but you can add a full config object). We have dynamically added a number to the TextField&#8217;s name by appending the item count which is necessary due to a (in my opinion) bug with the &#8216;<strong>getValues</strong>&#8216; method which I&#8217;ll discuss later.</p>
<p>Finally we call a wee doLayout to force the Form to redraw itself with the new field in place.</p>
<p>Now if you open the Step 2 HTML page and tap the Add button a new TextField will be added. That&#8217;s it, done!</p>
<p>These dynamically added fields will be automatically included in the form submission and if you add the following code to the Submit button&#8217;s handler you will get a popup that shows the output of the <strong>&#8216;getValues</strong>&#8216; method.</p>
<pre class="brush: jscript; title: ; notranslate">

var displayString = '';
var formValues = this.getValues();

for(var fieldName in formValues){
    displayString = displayString + fieldName + ': ' + formValues[fieldName] + '&lt;br/&gt;';
}

Ext.Msg.alert('Output of this.getValues()', displayString);
</pre>
<div class="box_info"><a title="Final Result" href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles1.1/Demos/Dynamic%20Sencha%20Touch%20Forms%20-%20Part%203/Step%202%20-%20Make%20it%20Dynamic.html">View the Final Result</a></div>
<div class="box_note"></p>
<p>The current implementation of the <strong>getValues</strong> method means that only Checkboxes can have the same name and consequently be sent to the server as an array on submission. The situations I&#8217;ve described previously are prime candidates to be sent as arrays which make it much easier to deal with on the server-side rather than having to parse field names with numbers suffixed. Therefore I think it&#8217;s a bug in the framework and should be changed to allow any field type to have the same name.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/05/dynamic-sencha-touch-forms-part-3-adding-form-fields-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Dynamic Sencha Touch Forms : Part 2 : Dynamically loading Select Fields based on previously selected values</title>
		<link>http://www.swarmonline.com/2011/05/dynamic-sencha-touch-forms-part-2-dynamically-loading-select-fields-based-on-previously-selected-values/</link>
		<comments>http://www.swarmonline.com/2011/05/dynamic-sencha-touch-forms-part-2-dynamically-loading-select-fields-based-on-previously-selected-values/#comments</comments>
		<pubDate>Fri, 06 May 2011 20:17:54 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Sencha Touch]]></category>
		<category><![CDATA[Web Design & Development Blog]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=1191</guid>
		<description><![CDATA[Firstly, apologies for the lateness of this follow up post! The aim of this post is to describe how we<a href="http://www.swarmonline.com/2011/05/dynamic-sencha-touch-forms-part-2-dynamically-loading-select-fields-based-on-previously-selected-values/">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>Firstly, apologies for the lateness of this follow up post!</p>
<p>The aim of this post is to describe how we can use Select Fields (combo-boxes) to create a form whose options change based on the previous selections made by the user. So basically when a user makes a selection from the first Select Field we want the next one&#8217;s possible values to change, reflecting the choice made.</p>
<p>The scenario we will use is a simple form where the User can choose a Country and then a City from two Select Fields which could be used in a form where a User completes their Address.</p>
<p><img title="More..." src="http://www.swarmonline.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><span id="more-1191"></span><br />
As with all our tutorials there is a <a href="http://www.swarmonline.com/wp-content/plugins/download-monitor/download.php?id=8">Tutorial Package</a> that contains all the files you need to try the examples and follow the tutorial step by step. If you click on the Step&#8217;s header you can view the demo for that step.</p>
<div class="box_download"><a href="http://www.swarmonline.com/wp-content/plugins/download-monitor/download.php?id=8">Dynamic Sencha Touch Forms - Part 2 - Tutorial Package</a></p>
<p>Just drop into the Sencha Touch &#8216;examples&#8217; directory</div>
<p><div class="box_info"><a title="Final Result" href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles1.1/Demos/Dynamic%20Sencha%20Touch%20Forms%20-%20Part%202/Step%202%20-%20Make%20it%20Dynamic.html">View the Final Result</a></div><br />
<span style="font-size: 20px; font-weight: bold;"><a title="Final Result" href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles1.1/Demos/Dynamic%20Sencha%20Touch%20Forms%20-%20Part%202/Step%201%20-%20Create%20our%20Form.html">Step 1 &#8211; Create the form</a></span></p>
<p>I have thrown together a quick form to demonstrate this idea which consists of 2 Models (Country &amp; City), 2 Stores (to contain the Country and City data) and a form with 2 Select Fields linked to the Country and City stores. If you view the Step 1 demo page (by clicking the Step 1 title) you will see that the first Select Fields contains 4 Countries and the second contains 8 Cities.</p>
<pre class="brush: jscript; title: ; notranslate">

DynamicForms.MyForm = Ext.extend(Ext.form.FormPanel, {

    initComponent: function(){

        Ext.apply(this, {
            floating: true,
            width: 350,
            height: 370,
            centered: true,
            modal: true,
            hideOnMaskTap: false,
            items: [{
                xtype: 'selectfield',
                label: 'Country',
                store: countryStore,
                displayField: 'CountryName',
                valueField: 'CountryID'
            }, {
                xtype: 'selectfield',
                label: 'City',
                store: cityStore,
                displayField: 'CityName',
                valueField: 'CityID'
            }]
        });

        DynamicForms.MyForm.superclass.initComponent.call(this);

     }
});
</pre>
<p>Now, at a basic level this form is fine &#8211; people should know what Country the city they live in is and they should be able to pick their City from an alphabetical list of cities. However, we know we&#8217;re better than this because this will no doubt cause some problems with data integrity later on (and we also know that, in general, we have to assume that all end-users are not very smart&#8230;) so we should make it easier and more bullet-proof. So, once the User has picked a Country we&#8217;re only going to give them the option to select a City that we already know is that chosen Country.</p>
<h2><a title="Final Result" href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles1.1/Demos/Dynamic%20Sencha%20Touch%20Forms%20-%20Part%202/Step%202%20-%20Make%20it%20Dynamic.html">Step 2 &#8211; Make it Dynamic!</a></h2>
<p>Like we did in the first Part we are going to hook into the &#8216;change&#8217; event of the first Select Field and filter the Store (containing the Cities) attached to the second Select Field. This is especially easy because we have our Models set up to have nice relationships between them meaning we can pick up the CountryID of the selected Country and apply that to the City store to get a list of Cities. Easy!</p>
<p>Firstly we&#8217;ll listen for the &#8216;change&#8217; event as we can see below. This code is placed below the initComponent superclass call and we also add the onCountryChange method that will be executed when the event happens:</p>
<pre class="brush: jscript; title: ; notranslate">

...
initComponent: function(){

    // config omitted

    DynamicForms.MyForm.superclass.initComponent.call(this);

    this.items.get(0).on({
        change: this.onCountryChange,
        scope: this
    });

},

onCountryChange: function(selectField, value){

}
...
</pre>
<p>Next we need to implement what happens when a new Country is chosen, i.e. the contents of our onCountryChange method.</p>
<p>In pseudocode this is what we want to do:</p>
<ol>
<li>Remove any Filter that is currently on the City select field</li>
<li>Add a new Filter based on the newly selected Country ID</li>
<li>Select the first City that appears in that list by default</li>
</ol>
<p>So, how do we actually do that?</p>
<h3>Remove any Existing Filters</h3>
<p>Firstly, we grab a reference to the City Select Field component using the &#8216;<strong>get</strong>&#8216; method of the items&#8217; MixedCollection.</p>
<pre class="brush: jscript; title: ; notranslate">

var citySelectField = this.items.get(1);
</pre>
<div class="box_note"><br />
The &#8216;<strong>this</strong>&#8216; reference in our <strong>onCountryChange</strong> method refers to our GridPanel. This is accomplished by using the &#8216;<strong>scope</strong>&#8216; config option when setting up the listener, which we assigned to the &#8216;this&#8217; value within the initComponent method.</p>
<p>We can use this config option to force the scope of the listeners which would otherwise be executed in the context of the component that fired them.</p>
</div>
<p>Next we remove the existing filter that is on the City select field. We do this by calling the &#8216;<strong>clearFilter</strong>&#8216; method of the Select Field&#8217;s store which we can access via the Select Field&#8217;s public property &#8216;<strong>store</strong>&#8216;.</p>
<pre class="brush: jscript; title: ; notranslate">

citySelectField.store.clearFilter(); // remove the previous filter
</pre>
<h3>Filter the Cities Based on the Selected Country</h3>
<p>The second of the two parameters that are passed into our &#8216;<strong>onCountryChange</strong>&#8216; method is the value that was selected. This is the Model instance&#8217;s CountryID because of the way we configured the Countries Select Field. If you look back to the first code snippet we set the &#8216;<strong>valueField</strong>&#8216; config option to &#8216;CountryID&#8217; which means that when calling methods such as &#8216;<strong>getValue</strong>&#8216; or &#8216;<strong>setValue</strong>&#8216; on this field you will be dealing with the CountryID of the selected Model instance.</p>
<p>Now that we know which Country has been selected, and the CountryID of it, we can use that to filter the Cities Select Field&#8217;s store by that value. This is a simple case of calling the &#8216;<strong>filter</strong>&#8216; method on the City store passing in the <strong>Field</strong> we want to filter on, and the <strong>Value</strong> to filter with. For anyone with SQL experience, this is performing a simple WHERE-style filtering, i.e. .filter(&#8216;CountryID&#8217;, 1) &lt;=&gt; WHERE CountryID = 1.</p>
<pre class="brush: jscript; title: ; notranslate">

citySelectField.store.filter('CountryID', value);
</pre>
<h3>Make a Default Selection</h3>
<p>The final step is to make sure that we keep things tidy. If you run your code right now you will find that the filtering works a treat but after selecting a City and then changing your Country, the selected City remains. We can&#8217;t have that because then an incorrect City could be submitted for the selected Country. We can fix this by automatically selecting the first City in the newly filtered list or, if there are no Cities available for the chosen Country, just set the value to a blank.</p>
<p>First we grab the first City in the filtered Store.</p>
<pre class="brush: jscript; title: ; notranslate">

var firstCity = citySelectField.store.getAt(0);
</pre>
<p>If there are no Cities present then the <strong>firstCity</strong> variable will be set to &#8216;undefined&#8217; and so we can use this as a check before we set the default City value because if there isn&#8217;t any we want to reset the Select Field to a blank string.</p>
<pre class="brush: jscript; title: ; notranslate">
// if not undefined we can set the value to the first record's CityID
if(firstCity){
 citySelectField.setValue(firstCity.data.CityID);
} else {
 citySelectField.setValue('');
}
</pre>
<p>That&#8217;s all we need to put in our change event handler and the full method looks like this:</p>
<pre class="brush: jscript; title: ; notranslate">

onCountryChange: function(selectField, value){
    var citySelectField = this.items.get(1);

    citySelectField.store.clearFilter(); // remove the previous filter

    // Apply the selected Country's ID as the new Filter
    citySelectField.store.filter('CountryID', value);

    // Select the first City in the List if there is one, otherwise set the value to an empty string
    var firstCity = citySelectField.store.getAt(0);
    if(firstCity){
        citySelectField.setValue(firstCity.data.CityID);
    } else {
        citySelectField.setValue('');
    }
}
</pre>
<p>The last bit of code we need is to force all this to happen when the form first loads because otherwise all the Cities are present in the list even though no Country is selected. We can do this by simply calling the &#8216;<strong>onCountryChange</strong>&#8216; method ourselves at the end of the initComponent method. We pass in a reference to the Country Select Field and a value (CountryID) of 1, which is the default selection.</p>
<pre class="brush: jscript; title: ; notranslate">

this.onCountryChange(this.items.get(0), 1);
</pre>
<p>And there we have it, a simple chained Select Field form.</p>
<p>This technique can improve your form in a couple of ways:</p>
<p><strong>We reduce the possibility of incorrect data hugely.<br />
</strong>There will always be someone who picks their Country as England and their City as Cardiff (obviously, being good app designers, we&#8217;re checking all this again on the serverside but we want to make that code redundant for the average, non-hacking user) so preventing them from doing this in the first place is an instant win.</p>
<p><strong>It enhances the user experience.</strong><br />
In our simple example the lists are only a few of entries long meaning finding the right entry is fairly easy, but imagine dealing with much larger lists and the problem is multiplied, leading to frustrated and angry users.</p>
<p>I hope this quick tutorial has helped you to add some more clever dynamics to your forms. If you have any ideas for other ways to make forms a little more clever then leave a comment and we will see if we can come up with wee tutorial explaining how to do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/05/dynamic-sencha-touch-forms-part-2-dynamically-loading-select-fields-based-on-previously-selected-values/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>20 Things To Avoid/Do When Getting Started With Ext JS &amp; Sencha Touch</title>
		<link>http://www.swarmonline.com/2011/05/20-things-to-avoid-or-do-when-getting-started-with-extjs-and-sencha-touch/</link>
		<comments>http://www.swarmonline.com/2011/05/20-things-to-avoid-or-do-when-getting-started-with-extjs-and-sencha-touch/#comments</comments>
		<pubDate>Wed, 04 May 2011 21:48:33 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Development Tips]]></category>
		<category><![CDATA[Ext JS]]></category>
		<category><![CDATA[Web Design & Development Blog]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=1065</guid>
		<description><![CDATA[When learning a new topic people often make the same mistakes and follow the same bad practices as each other.<a href="http://www.swarmonline.com/2011/05/20-things-to-avoid-or-do-when-getting-started-with-extjs-and-sencha-touch/">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>When learning a new topic people often make the same mistakes and follow the same bad practices as each other. It usually follows by them realising that what they&#8217;ve been doing for a few days/weeks/months is a bad way of doing it and wondering how they didn&#8217;t realise earlier.</p>
<p>In this article we&#8217;ve put together a (non-exhausted!) list of a few of the things we&#8217;ve picked up and things we recommend you do when starting out with Ext JS (hey, even you veteran developers might learn something new!). These things have come up through our own experience; through seeing and replying to the same issues on the forums again and again; and just general good programming practices.</p>
<p>Hopefully this will jump you a few rungs up the ladder of learning Ext JS and help you avoid falling into the usual traps!</p>
<p><span id="more-1065"></span></p>
<div class="box_info"></p>
<p>Although we are only explicitly talking about Ext JS, most, if not all, of these tips can be applied to Sencha Touch as the structure of the framework is so similar.</p>
</div>
<h3>Avoid using Ext.getCmp</h3>
<p>Don’t be tempted to give all your components IDs and then use Ext.getCmp to find them again. If you structure your applications correctly and apply the principles of Object Oriented (OO) design properly then you shouldn’t have a problem getting access to your components when you need them.</p>
<p>Useful References:</p>
<p><a title="Writing a Big Application by Saki" href="http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/" target="_blank">Writing a Big Application by Saki</a></p>
<p><a title="Component Communication by Saki" href="http://examples.extjs.eu/?ex=compcomm" target="_blank">Component Communication Example by Saki</a></p>
<h3>Avoid Using the ownerCt Property</h3>
<p>Don’t rely on the ownerCt property to get a component’s parent. Chances are if you’re wanting to access the component&#8217;s parent within its code then the code shouldn’t be there. The code should likely be in the parent itself. This is a similar thing to using Ext.getCmp (above) so make sure you read the linked articles!</p>
<h3>Do Not Overnest Components</h3>
<p>A hugely common mistake found in new Ext JS developers&#8217; code is the overnesting of Panels. Think carefully about your structure and remember that components such as Form<strong>Panel</strong>s, Grid<strong>Panel</strong>s and Tab<strong>Panel</strong>s all extend the Panel class so don&#8217;t need to be wrapped in another Panel. They can be placed wherever their more generic parents can and be configured with the same options.</p>
<h3>Be Careful of Spaghetti Code/Scope</h3>
<p>Don’t define all your components in one big file or all inline – it will be a nightmare to debug and your scope will be all over the place. Make things easy and split each component definition into its own file and extend the base class to add your configuration and extra methods and behaviours.  This way you can simply instantiate these components where you need them keeping things nice and tidy and loosely coupled.</p>
<p>If you don&#8217;t want to extend base classes all the time then using Factory Methods is another option.</p>
<h3>Make Sure You Use Namespaces</h3>
<p>Again, its all about organisation. Utilise the inbuilt namespace capabilities of Ext JS to organise your components and classes so its easy to navigate later. Typically you would want to do this by functional module, for example, MyApp.Users for all the User management code. I like to mirror this namespace structure with the folder structure so everything is dead easy to find.</p>
<h3>Use Get/Set Methods or Static References</h3>
<p>Don’t be tempted to delve into a component’s items or toolbar collections to get a reference to a particular button or panel using the ‘comp.get(0)’ or comp.getTopToolbar().get(1)’ syntax. If you ever add items to these collections the references will be broken and you will have to track them down. In a big application this becomes a mammoth task which will introduce bugs.</p>
<p>Save yourself some hassle and, in the extended class, create a get method for the necessary components, which delves into the collection, so when you do add more items you know there is only one method to be updated. Or, if you aren&#8217;t concerned about lazy instantiation, define your buttons and items as class variables and reference them that way so you won’t need to make any updates when new items are added.</p>
<h3>Name Your xtypes Carefully</h3>
<p>Name your xtypes the same as your class, including namespaces, so you can track down the actual class definition very easily.</p>
<h3>Reuse Your Code</h3>
<p>If you find yourself writing the same code again and again (think masking elements while loading, response/error handling code etc) then wrap that stuff in a function in a way that makes it generic and reuse it. Save yourself the time, effort and RSI – you’ll thank yourself when you decide to change it and have to change hundreds of copies.</p>
<h3>Try Not to Nest Functions</h3>
<p>Don&#8217;t define functions within functions  (within functions&#8230;within functions&#8230;). You may think your doing some good code reuse but your just creating a scoping and organisation nightmare. Trying to follow that sort of nesting is not pleasant, so spare a thought for your co-workers who might have to debug it.</p>
<h3>Learn how to use FireBug</h3>
<p>&#8230;or WebKit&#8217;s Developer tools. Make sure you install and use an in-browser tool like <a title="Get FireBug!" href="http://getfirebug.com/" target="_blank">FireBug</a> to debug your Javascript and to explore what HTML and CSS the framework is creating. It&#8217;s easy to forget that, at the ground level, all Ext is doing is generating markup and these tools will give you an insight into what&#8217;s happening in the black box. If you learn how to use these tools properly and how to debug your JS effectively you will save yourself a huge amount of time.</p>
<p>Not to mention everything else it can do &#8211; Monitor AJAX requests, DOM exploration, real-time CSS changes etc etc</p>
<h3>Make it a White Box!</h3>
<p>As Evan says &#8220;Don&#8217;t be afraid of the source code!&#8221;. Use your new found FireBug knowledge to break into the Ext JS Framework rather than always stepping over those calls. It&#8217;s incredible how much you can learn and how easily you can find a problem by stepping into a framework method, not to mention the hours of stress trying to figure out a problem.</p>
<h3>Always Have the Docs Open</h3>
<p>The <a title="ExtJS API Documentation" href="http://dev.sencha.com/deploy/dev/docs/" target="_blank">API documentation</a> is your best friend &#8211; it should be your first port of call when running into problems or when trying something new. Intellisense for Ext JS isn&#8217;t quite up to the standards of Visual Studio for .NET so we can&#8217;t get away with being so lazy &#8211; the docs are the answer to this. They are well laid out and easy to navigate, so make use of them!</p>
<h3>Debugging Chain</h3>
<p>How you should go about fixing a problem&#8230;</p>
<p>Check <strong>your Code</strong> (it&#8217;s easy to misspell config options, miss commas etc)</p>
<p>Refer to the <strong>Documentation</strong> (you might be missing a related config option)</p>
<p>Step into the <strong>Framework&#8217;s Source Code </strong>(break into the code around the error and try to see what&#8217;s going wrong, you&#8217;ll likely discover a config option you&#8217;ve missed, or realise something you expected to be there isn&#8217;t instantiated yet)</p>
<p>Search the <strong>Forum</strong> (it&#8217;s almost a guarantee that someone will have had the same problem and posted a question about it)</p>
<p>Search the <strong>wider WWW</strong> (if the forum can&#8217;t help the wider web might be able to)</p>
<p><strong>Post </strong>on the Forum (if you still can&#8217;t find the resolution, create a new thread with as much detail about the problem as you can &#8211; make it easy for people to help you)</p>
<h3>Build it Up Gradually</h3>
<p>It&#8217;s all too easy to get too excited about a project and dive right in and create half a dozen components and then open the browser and give it a try. If it doesn&#8217;t work it can be very difficult to move backwards trying to find the culprit. We suggest creating things a stage at a time and gradually build it up once you&#8217;re sure each thing works as you want. For example, if you&#8217;re trying to create DataView that allows new items to be added to it with the new item being animated in &#8211; get the new items adding first then move on to animating it. If you try to do everything at once something&#8217;s likely to go wrong.</p>
<h3>Minify &amp; GZip your Production Code</h3>
<p>We recommend separating out all of your components into their own files. This means you&#8217;re going to have a bucket load of requests to download them all so make sure you minify your scripts into a single file to minimise the number of requests and to compress the file size.</p>
<p>Once you&#8217;ve done this make sure your server is set up to GZip your scripts. This can reduce the download size by about 70%!</p>
<h3>Don&#8217;t Edit the Framework Code</h3>
<p>Yes, delve into it, read it, test it, learn from it &#8211; but don&#8217;t edit it! If you start making changes to the core library, whether it is the JS or CSS, you are planting a ticking time-bomb into your application. When you come to upgrade to a newer version all those changes will be lost and you will have to traipse through trying to figure out where things are broken!</p>
<p>If you want to alter the behaviour/look of the framework then go for it but do it by <strong>overriding</strong> the class (be it a JS class or a CSS class) or method in a seperate script file. By doing this you can remove it if necessary and keep track of it when it comes to reviewing those changes when new versions are released.</p>
<h3>Use Plugins and User Extensions</h3>
<p>If you are wanting a component to do something that is fairly generic and a common functional requirement it is likely that someone has already coded it and released it as a Plugin or an Extension. Take some time before coding it from scratch (unless you have the time &#8211; it&#8217;s a great way to learn!) to search the forums and the web for a pre-made solution.</p>
<h3>Define Generic Items in a Central Location</h3>
<p>It&#8217;s handy to define all your variables, namespaces etc that are used application wide in a single config file. This keeps everything in one place, makes values easier to update and encourages reuse.</p>
<h3>Consider Using Ext Direct</h3>
<p>Ext.Direct is a brilliant feature of the Ext JS Framework and we highly recommend you implement it from the outset. It has various advantages including increasing speed, reducing code and a simplified way of interacting with your server. If you think you might consider it in the future, don&#8217;t, consider it now. It&#8217;s far easier to implement from the outset than convert everything over. You&#8217;ll thank us in the long run!</p>
<h3>Test on All Browsers!</h3>
<p>Although Ext JS takes care of 99% of cross browser issues always remember to test your application across all the browsers &#8211; especially IE! The usual IE CSS issues are common when creating custom data views and JS errors such as rogue commas will bring your application to its knees.</p>
<p>If you have any of your own tips or best practises please leave us a comment and we&#8217;ll add them to the list!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/05/20-things-to-avoid-or-do-when-getting-started-with-extjs-and-sencha-touch/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Ext.ux.touch. ListOptions : Add a Twitter style menu to your List Items</title>
		<link>http://www.swarmonline.com/2011/03/ext-ux-touch-listoptions-add-a-twitter-style-menu-to-your-list-items/</link>
		<comments>http://www.swarmonline.com/2011/03/ext-ux-touch-listoptions-add-a-twitter-style-menu-to-your-list-items/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 21:26:36 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Sencha Touch]]></category>
		<category><![CDATA[Sencha Touch Extensions & Plugins]]></category>
		<category><![CDATA[Web Design & Development Blog]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=1014</guid>
		<description><![CDATA[Overview This plugin duplicates the functionality found in Twitter&#8217;s mobile apps where an options menu is exposed after swiping over<a href="http://www.swarmonline.com/2011/03/ext-ux-touch-listoptions-add-a-twitter-style-menu-to-your-list-items/">(more...)</a>]]></description>
			<content:encoded><![CDATA[<h2>Overview</h2>
<p>This plugin duplicates the functionality found in Twitter&#8217;s mobile apps where an options menu is exposed after swiping over an item in a list. The plugin was created as an &#8216;I wonder if that&#8217;s possible&#8217; type project and serves to prove once again that anything native apps can do Sencha Touch can do too.</p>
<div class="box_download">Extract the ZIP file into the &#8216;examples&#8217; directory of the Sencha Touch libary package.</p>
<p><a href="http://www.swarmonline.com/wp-content/plugins/download-monitor/download.php?id=7">Download - Ext.ux.touch.ListOptions (14kb)</a></div>
<p><span id="more-1014"></span></p>
<p><div class="box_info"><a title="Ext.ux.touch.ListOptions Demo" href="http://www.swarmonline.com/2011/03/ext-ux-touch-listoptions-demo/">Demo &#8211; Ext.ux.touch.ListOptions</a></p>
<p>The demo shows the basic List example with the plugin applied and with a few items in the options menu.</p>
</div><br />
<a href="http://www.swarmonline.com/wp-content/uploads/2011/03/Screenshot.png"><img class="aligncenter size-full wp-image-1159" title="SwarmOnline.com's Ext.ux.touch.ListOptions" src="http://www.swarmonline.com/wp-content/uploads/2011/03/Screenshot.png" alt="" width="355" height="651" /></a></p>
<h2>The Plugin</h2>
<p>The plugin is added to Ext.List components and requires only a few configuration options to get it up and running quickly, however it also offers quite a lot of control over its behaviour.</p>
<h3>Configuration Options</h3>
<table style="height: 573px;" border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td width="25%" valign="top"><strong>optionsSelector</strong></td>
<td width="75%" valign="top">Selector to use to get the dynamically created List Options Ext.Element (where the menu options are held)Once hidden the List Options element will be removedDefaults to &#8216;<strong>x-list-options</strong>&#8216;</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>menuOptions</strong></td>
<td width="75%" valign="top">An array of objects to be applied to the &#8216;<strong>listOptionsTpl</strong>&#8216; XTemplate to create the List Options menu</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>menuOptionSelector</strong></td>
<td width="75%" valign="top">Selector to use to get individual List Options within the created Ext.ElementThis is used when attaching event handlers to the menu optionsDefaults to &#8216;<strong>x-menu-option</strong>&#8216;</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>menuOptionsTpl</strong></td>
<td width="75%" valign="top">Ext.XTemplate to use to create the List Options view</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>menuOptionPressedClass</strong></td>
<td width="75%" valign="top">CSS Class that is applied to the tapped Menu Option while it is being touched. Defaults to &#8216;<strong>x-menu-option-pressed</strong>&#8216;</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>menuOptionDataFilter</strong></td>
<td width="75%" valign="top">Set to a function that takes in 2 arguments &#8211; your initial &#8216;<strong>menuOptions</strong>&#8216; config option and the current item&#8217;s Model instance.<br />
The function must return either the original &#8216;menuOptions&#8217; variable or a revised one</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>revealAnimation</strong></td>
<td width="75%" valign="top">Animation used to reveal the List Options. Only works properly with &#8216;<strong>slide</strong>&#8216; animation right now.Defaults to:{<br />
reverse: false,<br />
type: &#8216;slide&#8217;,<br />
duration: 500<br />
}</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>revealDirection</strong></td>
<td width="75%" valign="top">The direction the List Item will slide to reveal the List Options<br />
Possible values: &#8216;left&#8217;, &#8216;right&#8217; and &#8216;both&#8217;<br />
Setting to &#8216;both&#8217; means it will be decided by the direction of the User&#8217;s swipe if &#8216;<strong>triggerEvent</strong>&#8216; is set to &#8216;<strong>itemswipe</strong>&#8216;</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>swipeThreshold</strong></td>
<td width="75%" valign="top">Distance (in pixels) a User must swipe before triggering the List Options to be displayed.Set to -1 to disable threshold checks</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>swipeDirection</strong></td>
<td width="75%" valign="top">The direction the user must swipe to reveal the menuOnly applicable when &#8216;<strong>triggerEvent</strong>&#8216; is set to &#8216;<strong>itemswipe</strong>&#8216;.Possible values: &#8216;left&#8217;, &#8216;right&#8217; or &#8216;both&#8217;. Defaults to &#8216;both&#8217;</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>triggerEvent</strong></td>
<td width="75%" valign="top">Ext.DataView event used to trigger the menu revealUsual values are &#8216;<strong>itemswipe</strong>&#8216;, &#8216;<strong>itemtap</strong>&#8216;, &#8216;<strong>itemdoubletap</strong>&#8216;Notes:<br />
<strong>itemswipe</strong>: see configs &#8216;<strong>swipeThreshold</strong>&#8216; &amp; &#8216;<strong>swipeDirection</strong>&#8216;</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>stopScrollOnShow</strong></td>
<td width="75%" valign="top">Stops the Ext.List from continuing its scrolling when a List Options menu is about to open.Accepts a boolean value. Defaults to true.</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>hideOnScroll</strong></td>
<td width="75%" valign="top">Decides whether the visible List Options menu is hidden when the List is scrolled. Accepts a boolean value</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>allowMultiple</strong></td>
<td width="75%" valign="top">Decides whether multiple List Options can be visible at once. Accepts a boolean value. Defaults to false</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>enableSoundEffects</strong></td>
<td width="75%" valign="top">Decides whether a sound effect will be played when the List Options menu opens and closes. Accepts a boolean value. Defaults to false</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>openSoundEffectURL</strong></td>
<td width="75%" valign="top">URL for the sound effect to play when the List Options menu opens (see <strong>enableSoundEffects</strong>). Set to blank string to prevent sound from playing.</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>closeSoundEffectURL</strong></td>
<td width="75%" valign="top">URL for the sound effect to play when the List Options menu closes (see <strong>enableSoundEffects</strong>). Set to blank string to prevent sound from playing.</td>
</tr>
</tbody>
</table>
<h3>Events</h3>
<p>The plugin adds 3 events to the parent Ext.List component.</p>
<table style="height: 573px;" border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td width="111" valign="top"><strong>menuoptiontap</strong></td>
<td width="479" valign="top">This event is fired when the User taps one of the List Options&#8217; Menu Item &#8211; what Elements this event fires on is based on the &#8216;<strong>menuItemSelector</strong>&#8216;.The event passes 2 parameters to its handler:<strong>menuItemData</strong>: this is the array item from the &#8216;<strong>menuOptions</strong>&#8216; array to allow you to perform different functionality based on what menu item was tapped&nbsp;</p>
<p><strong>activeListRecord</strong>: the record associated with the List item that the List Options menu is showing for</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>beforelistoptionstap</strong></td>
<td width="75%" valign="top">Fired when a List Options menu item is tapped. Takes 2 parameters &#8211; the first is the object associated with the tapped menu item from the &#8216;menuOptions&#8217; config. The second is the Model instance associated with the current menu&#8217;s List Item.&nbsp;</p>
<p>This event must return true or false. A true return value will mean the tap will execute as normally (the pressed state will occur and the &#8216;<strong>menuoptiontap</strong>&#8216; event will fire. If false the tap will stop and no other actions will occur.</p>
<p>This is a useful event to tailor menu option behaviour to the individual Model currently being dealt with.</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>listoptionsopen</strong></td>
<td width="75%" valign="top">Fired when the List Options menu is opened</td>
</tr>
<tr>
<td width="25%" valign="top"><strong>listoptionsclose</strong></td>
<td width="75%" valign="top">Fired when the List Options menu is closed</td>
</tr>
</tbody>
</table>
<h2>An Example</h2>
<p>I&#8217;ll talk through a simple example that is based on the Ext.List demo in the Sencha Touch download package.</p>
<p>First I&#8217;ll quickly explain the Model, Store and plain List. I&#8217;ll assume you have a base index.html file with all the library files etc linked into it.</p>
<h3>Defining the plugin</h3>
<pre class="brush: jscript; title: ; notranslate">

Ext.regModel('Contact', {
    fields: ['firstName', 'lastName']
});

var store = new Ext.data.JsonStore({
    model: 'Contact',
    getGroupString: function(record){
        return record.get('lastName')[0];
    },
    data: [{
        firstName: 'Tommy',
        lastName: 'Maintz'
    }
    ...
    {
        firstName: 'Jay',
        lastName: 'Robinson'
    }]
});

var list = new Ext.List({
    fullscreen: true,
    itemTpl: '{firstName} {lastName}',
    indexBar: true,
    store: store,
    disableSelection: true
});

list.show();
</pre>
<p>If you fire this inside your Ext.setup function and load the page you should see a list with some of Sencha&#8217;s employees in it.</p>
<p>Now, let&#8217;s add the plugin!</p>
<p>Firstly make sure you&#8217;ve added the Plugin&#8217;s source file and CSS file.</p>
<pre class="brush: jscript; title: ; notranslate">
//Inside the Ext.List's config
...
plugins: [new Ext.ux.touch.ListOptions({
    menuOptions: [{
        id: 'Team Icon Tapped',
            img: 'images/team1_small.png'
    }, {
        id: 'Favourite Icon Tapped',
        img: 'images/favorites1_small.png'
    }, {
        id: 'Cart Icon Tapped',
        img: 'images/shop2_small.png'
    }, {
        id: 'Share Icon Tapped',
        img: 'images/share_small.png'
    }]
})]
...
</pre>
<p>By taking the default values for all the other config options and adding some menuOptions we get the plugin up and running straight away. You can now play around with the various options to get the plugin working how you want!</p>
<p>If you have any problems with using the plugin, have questions about how it works or have suggestions about ways we can make it better then please leave us a comment or drop us an email!</p>
<div class="box_download">Extract the ZIP file into the &#8216;examples&#8217; directory of the Sencha Touch libary package.</p>
<p><a href="http://www.swarmonline.com/wp-content/plugins/download-monitor/download.php?id=7">Download - Ext.ux.touch.ListOptions (14kb)</a></div>
<div class="box_info"><a title="Ext.ux.touch.ListOptions Demo" href="http://www.swarmonline.com/2011/03/ext-ux-touch-listoptions-demo/">Demo &#8211; Ext.ux.touch.ListOptions</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/03/ext-ux-touch-listoptions-add-a-twitter-style-menu-to-your-list-items/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ext.ux.touch.ListOptions : Demo</title>
		<link>http://www.swarmonline.com/2011/03/ext-ux-touch-listoptions-demo/</link>
		<comments>http://www.swarmonline.com/2011/03/ext-ux-touch-listoptions-demo/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 21:06:02 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=1005</guid>
		<description><![CDATA[Swipe across a List Item to reveal an extra options menu.]]></description>
			<content:encoded><![CDATA[<p>Swipe across a List Item to reveal an extra options menu.</p>
<div class="box_download">Extract the ZIP file into the &#8216;examples&#8217; directory of the Sencha Touch libary package.</p>
<p><a href="http://www.swarmonline.com/wp-content/plugins/download-monitor/download.php?id=7">Download - Ext.ux.touch.ListOptions (14kb)</a></div>
<div class="non-webkit-warning box_info">You are currently not using a WebKit browser. Please reopen this page in <a href="http://www.google.co.uk/chrome">Google Chrome</a> or <a href="http://www.apple.com/safari/">Safari</a> to get the full experience.</div><script>if(jQuery.browser.webkit){ jQuery('.non-webkit-warning').hide(); }</script><div style="position: absolute; left: 50%; margin-left: -221px; background-image: url('http://www.swarmonline.com/wp-content/plugins/SenchaTouchDemo/iPhone.png'); height: 790px; width: 441px;"></div><iframe src="http://www.swarmonline.com/wp-content/uploads/TutorialFiles1.1/Demos/Ext.ux.touch.ListOptions" style="position: relative; left: 50%; margin-top: 173px; margin-left: -159px;" width="320px" height="480px"><p>Your browser does not support iframes.</p></iframe><br/><br/><br/><br/><br/><br/><br/><br/><br/><a href="2011/03/ext-ux-touch-listoptions-add-a-twitter-style-menu-to-your-list-items" class="action_button" style="float: left"><span>View Blog Post</span></a><a href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles1.1/Demos/Ext.ux.touch.ListOptions" class="action_button"><span>View Without Frame</span></a><div class="clear"></div><br/><br/><br/>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/03/ext-ux-touch-listoptions-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Reasons Why Ext JS 4&#8242;s Charts Are Awesome</title>
		<link>http://www.swarmonline.com/2011/03/10-reasons-why-extjs4-charts-are-awesome/</link>
		<comments>http://www.swarmonline.com/2011/03/10-reasons-why-extjs4-charts-are-awesome/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 16:51:13 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Ext JS]]></category>
		<category><![CDATA[Web Design & Development Blog]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=1057</guid>
		<description><![CDATA[The new Charting package that is shipping with the latest Ext JS 4 Preview is fantastic and really does dwarf<a href="http://www.swarmonline.com/2011/03/10-reasons-why-extjs4-charts-are-awesome/">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>The new Charting package that is shipping with the latest Ext JS 4 Preview is fantastic and really does dwarf the previous releases offering (which was also very good). I&#8217;m going to outline a few of the key features that make it so good.</p>
<p><span id="more-1057"></span></p>
<h3>Flashy? Yes. Flash? No</h3>
<p>First things first, no Flash. That&#8217;s right, beautiful, animated, colourful, shiny graphs without any nasty plugins needed. Ideal. It relies on the Ext.draw package which uses SVG, Canvas or VML depending on what your browser has to offer and draws them directly on the page.</p>
<h3>Maximum Interactivity</h3>
<p>People like clicking stuff, your boss definitely wants to be able to click a graph point and have that data jump straight into his brain or at the very least expand out into a nice summary window. Now you can keep him happy.</p>
<p>Every part of the chart is a regular Ext object so you can attach to events and add functionality just like you would with any other part of Ext.</p>
<h3>Create any Chart Style</h3>
<p>You can create your own chart types by extending the Cartseisan Series class (or one of its sub-classes). This means you can finally have that bar chart that renders 10 bananas in a row to represent the amount of lunch your pet monkeys are actually eating. Sure, its not going to be that easy but its possible!</p>
<h3>Smooooth Curves</h3>
<p>Like things to be gentle and smooth? You&#8217;re in luck! You can now render line graphs with smooth paths through each point. Unfortunately it&#8217;s VERY difficult and requires a lot of code&#8230;</p>
<pre class="brush: jscript; title: ; notranslate">

smooth: true
</pre>
<p>Oh wait, nope, that&#8217;s all it takes.</p>
<h3>Variety out the Box</h3>
<p>The sheer number of built in chart types is huge. At the base level you have 7 different types:</p>
<ul>
<li>Bar</li>
<li>Column</li>
<li>Pie</li>
<li>Scatter</li>
<li>Radar</li>
<li>Area</li>
<li>Line</li>
</ul>
<p>And each of these has a boat load of configuration options to make them pretty unique even to themselves. And, as I mentioned before, its easily expandable until your imagination explodes.</p>
<h3>Resolution Independent</h3>
<p>All the graphs are created as vector graphics so you can zoom until your heart&#8217;s content without losing quality.</p>
<h3>Customise. Everything.</h3>
<p>Each tiny aspect of an Ext JS 4 chart can have its look customised through nothing fancier that its config object. From things like the appearance of a Line Graph&#8217;s point markers to the style of a pie slice when it&#8217;s hovered over &#8211; it&#8217;s all there, ready for people to make the most hideous looking graphs since Excel c.1999.</p>
<h3>Make friends with Ext 3</h3>
<p>You can use it with Ext 3! Yes, you heard me right. You can have Ext JS 4&#8242;s charting package sitting right alongside your Ext 3.x application and everyone will play nicely and won&#8217;t fight.</p>
<h3>Mobile Friendly</h3>
<p>You can use them with Sencha Touch. Ok, not yet but that is the plan and the way they have been written means it will be easy and work across all WebKit browsers.</p>
<h3>Make Your Life Easier</h3>
<p>Let&#8217;s be honest, the power that this charting and drawing package provides is going to make us developers&#8217; lives much easier and keep our bosses happier than ever. This can only be a good thing, but will undoubtedly result in their imaginations running wild and demanding more &#8211; I&#8217;m confident that the future releases and the community contributions won&#8217;t disappoint!</p>
<p>Let us know if you&#8217;ve been tinkering with Ext JS 4 and its charting package and have some more words of praise.</p>
<p>For more information on Ext JS 4&#8242;s Charting package check out the links below:</p>
<p><a title="ExtJS 4 Charts and Drawing Demos" href="http://dev.sencha.com/deploy/ChartsDemo/" target="_blank">Ext JS 4 Charts and Drawing Demos</a></p>
<p><a title="Introduction to Charting and Drawing blog post" href="http://www.sencha.com/blog/ext-js-4-preview-drawing-and-charting/" target="_blank">Introduction to Charting and Drawing blog post</a></p>
<p><a title="Sencha Conference 2010 Charting Presentation" href="http://vimeo.com/17673342" target="_blank">Sencha Conference 2010 Charting Presentation</a></p>
<p><a title="Sencha Conference 2010 Charting Slides" href="http://www.slideshare.net/senchainc/charts-5971878" target="_blank">Sencha Conference 2010 Charting Slides</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/03/10-reasons-why-extjs4-charts-are-awesome/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HOW TO: Dynamically Change Layout Based on the User&#8217;s Device with Sencha Touch</title>
		<link>http://www.swarmonline.com/2011/03/how-to-dynamically-change-layout-based-on-the-users-device-with-sencha-touch/</link>
		<comments>http://www.swarmonline.com/2011/03/how-to-dynamically-change-layout-based-on-the-users-device-with-sencha-touch/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 17:54:40 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Sencha Touch Extensions & Plugins]]></category>
		<category><![CDATA[Web Design & Development Blog]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=650</guid>
		<description><![CDATA[Occasionally we will want to tailor the layout of our app to suit the device that the User is viewing<a href="http://www.swarmonline.com/2011/03/how-to-dynamically-change-layout-based-on-the-users-device-with-sencha-touch/">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>Occasionally we will want to tailor the layout of our app to suit the device that the User is viewing it on. Generally we want to do this to take advantage of the increased screen real estate made available by devices such as tablets compared to the usual phone or iPod. For example, showing a list of search results alongside a map rather than having them one behind the other in a card layout.<br />
<span id="more-650"></span><br />
<div class="box_download"><a href="http://www.swarmonline.com/wp-content/plugins/download-monitor/download.php?id=6">Device Specific Views - Tutorial Files (11kb)</a></div></p>
<p>or view the live demo (please use Safari, Google Chrome or your Smartphone!)</p>
<div class="box_info"><a title="Dynamically Change the Layout" href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles/Demos/Device%20Specific%20Layouts/Step%202%20-%20Dynamically%20Change%20the%20Layout.html">Demo &#8211; Dynamically Changing Layouts</a></div>
<h2><a href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles/Demos/Device%20Specific%20Layouts/Step 1 - Basic Card Layout.html" target="_blank">Step 1 : Basic Card Layout</a></h2>
<p>The theory behind achieving this is pretty simple. We decide if we&#8217;re on a phone or a tablet and then alter the defined &#8216;<strong>layout</strong>&#8216; config accordingly. We&#8217;ll set up a simple example with a list and a map in a card layout initially, with a button in a docked toolbar that will switch between them.</p>
<pre class="brush: jscript; title: ; notranslate">

Ext.ns('SwarmOnline');

SwarmOnline.CardPanel = Ext.extend(Ext.Panel, {

    initComponent: function(){
        var layoutCustom = 'card';

        var itemCustom = [{
            xtype: 'list',
            itemTpl: '{firstName} {lastName}',
            indexBar: true,
            store: store,
            disableSelection: true
        }, {
            xtype: 'map'
        }];

        var dockedItems = [{
            dock: 'top',
            xtype: 'toolbar',
            items: [{
                text: 'Switch',
                handler: this.onSwitchTap,
                scope: this
            }]
        }];

        Ext.apply(this, {
            fullscreen: true,
            layout: layoutCustom,
            items: itemCustom,
            dockedItems: dockedItems
        });

        SwarmOnline.CardPanel.superclass.initComponent.call(this);
    },

    onSwitchTap: function(){
        this.setActiveItem(this.getActiveItem() === this.items.get(0) ? 1 : 0);
    }
});

var cardPanel = new SwarmOnline.CardPanel();
</pre>
<p>If you open the demo for this step (by clicking the above) you will see a list and then a map if you click the Switch button. That&#8217;s a great start and is how most apps would display such data but what if the user is using an iPad? That list will be stretched hugely in the x-axis and will probably look pretty naff, so why not show both?</p>
<p>Before we move on, note that we defined the <strong>items</strong> and <strong>layout</strong> config options in variables and then put them into the Ext.apply call, we did this so we can fiddle with them before doing the final configuration.</p>
<h2><a href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles/Demos/Device%20Specific%20Layouts/Step%202%20-%20Dynamically%20Change%20the%20Layout.html" target="_blank">Step 2 : Dynamically Change the Layout</a></h2>
<p>So what we want to do is display the list at one side of the screen and the map alongside it so they can be viewed simultaneously giving a much better experience to the user and also improving the appearance of the list greatly. To do this we add a new method to decide what sort of device we&#8217;re on and then alter the &#8216;<strong>layout</strong>&#8216; variable depending on the result. In this case if it isn&#8217;t a Phone/iPod then we&#8217;re going to make it use an <strong>hbox</strong> layout with a 1/3 flex.</p>
<pre class="brush: jscript; highlight: [4,11,26,27,28,29,30]; title: ; notranslate">

initComponent: function(){
    var layout = 'card';
    var items = [{
        flex: 1,
        xtype: 'list',
        itemTpl: '{firstName} {lastName}',
        indexBar: true,
        store: store,
        disableSelection: true
    }, {
        flex: 3,
        xtype: 'map'
    }];

    var dockedItems = [{
        dock: 'top',
        xtype: 'toolbar',
        items: [{
            text: 'Switch',
            handler: this.onSwitchTap,
            scope: this
        }]
    }];

    if (!this.isPhone()) {
        layout = {
            type: 'hbox',
            align: 'stretch',
            pack: 'justify'
        };
        dockedItems = [];
    }
}
</pre>
<p>..and then the method to decide what device the user is on&#8230;</p>
<pre class="brush: jscript; title: ; notranslate">
...
isPhone: function(){
    return Ext.is.Phone || Ext.is.iPod;
}
...
</pre>
<p>As you can see on Line 4 and 11 we add a flex config option &#8211; this will be ignored if we are using a card layout so it can be set straight away no matter what the device. We then call our <strong>isPhone</strong> method, and if it isn&#8217;t a Phone/iPod then we change the value of the <strong>layout</strong> variable to be an <strong>hbox</strong> config (Line 26-30) and reset the <strong>dockedItems</strong> array so the Switch button doesn&#8217;t show. If you run this code (or click the Step 2 header) then you should see (assuming your on a PC/Mac and not a phone) the List and Map side by side.</p>
<p>So there we go, dynamic layouts based on the user&#8217;s device &#8211; easy!</p>
<p>Please post a comment or email us if you have any problems or suggestions!</p>
<div class="box_download"><a href="http://www.swarmonline.com/wp-content/plugins/download-monitor/download.php?id=6">Device Specific Views - Tutorial Files (11kb)</a></div>
<p>or view the live demo (please use Safari, Google Chrome or your Smartphone!)</p>
<div class="box_info"><a title="Dynamically Change the Layout" href="http://www.swarmonline.com/wp-content/uploads/TutorialFiles/Demos/Device%20Specific%20Layouts/Step%202%20-%20Dynamically%20Change%20the%20Layout.html">Demo &#8211; Dynamically Changing Layouts</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/03/how-to-dynamically-change-layout-based-on-the-users-device-with-sencha-touch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Integrate JS Builder 3 with Eclipse or Aptana on Windows</title>
		<link>http://www.swarmonline.com/2011/02/how-to-integrate-js-builder-3-with-eclipse-or-aptana-on-windows/</link>
		<comments>http://www.swarmonline.com/2011/02/how-to-integrate-js-builder-3-with-eclipse-or-aptana-on-windows/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 23:40:44 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Development Tips]]></category>
		<category><![CDATA[Ext JS]]></category>
		<category><![CDATA[Sencha Touch]]></category>
		<category><![CDATA[Web Design & Development Blog]]></category>

		<guid isPermaLink="false">http://www.swarmonline.com/?p=1043</guid>
		<description><![CDATA[Overview Integrating JS Builder 3 with Eclipse or Aptana may save you some time building your Javascript application for a<a href="http://www.swarmonline.com/2011/02/how-to-integrate-js-builder-3-with-eclipse-or-aptana-on-windows/">(more...)</a>]]></description>
			<content:encoded><![CDATA[<h2>Overview</h2>
<p>Integrating JS Builder 3 with Eclipse or Aptana may save you some time building your Javascript application for a testing or production environment.</p>
<p><div class="box_info">The aim of JS Builder is, ultimately, to make your website or application load quicker. It does this by combining your Javascript and CSS files, minifying them and outputting them to fewer files. You may, for example, opt to have one CSS file, and two Javascript files (Ext-all.js and app.js). This results in far fewer requests to your server which, although the individual file sizes are larger, boosts performance.</div><br />
<span id="more-1043"></span><br />
It&#8217;s also ideal if you want to pick and choose which bits of the Ext JS or Sencha Touch frameworks you require. You don&#8217;t need to include functionality from the framework that your application doesn&#8217;t use. If you&#8217;re not using any charting or drag&#8217;n'drop in your application then why include it in your Ext-all.js? This is just unnecessary overhead and reduces overall performance.</p>
<h2>Integrating</h2>
<p>So, first off you need to get a copy. It&#8217;s currently included with <a href="http://www.sencha.com/products/touch/download/">Sencha Touch</a> and will undoubtedly be included with Ext JS 4 when it&#8217;s fully released.</p>
<p>I&#8217;m not going to talk you through how to actually pick and choose files. The .jsb3 and .jsb2 files included with Sencha Touch and Ext JS are pretty self explanatory and there is plenty of documentation.</p>
<h3>External Tools Configuration</h3>
<p>We need to use the &#8220;External Tools Configuration&#8221; features in Eclipse for this to work. There are two ways to access this:</p>
<p>1. Right Click your <strong>Project </strong>-&gt; Choose <strong>Properties </strong>-&gt; <strong>Builders</strong>.</p>
<p>2. In the <strong>top toolbar</strong> there is a &#8220;<strong>External Tools</strong>&#8221;  button (green play button with a small toolbox). In it&#8217;s menu there is an &#8220;<strong>External Tools Configuration</strong>&#8221; option.</p>
<h3>Step by step:</h3>
<ol>
<li>Click &#8220;<strong>New</strong>&#8220;</li>
<li>Select &#8220;<strong>Program</strong>&#8221; from the &#8220;Choose configuration type&#8221; selection</li>
<li>We only need to use the &#8220;<strong>Main</strong>&#8221; tab. You&#8217;ll need to give it the following parameters:</li>
</ol>
<p><strong>Location:</strong></p>
<p>This is the path to cmd.exe which should be &#8220;<strong>C:\WINDOWS\system32\cmd.exe</strong>&#8221; without the quotes.</p>
<p><strong>Working Directory:</strong></p>
<p>The working directory is the directory where JSBuilder.bat is stored. In my case I&#8217;ve included the JSBuilder files in the project.</p>
<p>I&#8217;m therefore going to make use of the Variables on offer. More information can be found in Eclipses <a href="http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/concepts-exttools.htm">documentation</a>.</p>
<p>So in the working directory we use &#8220;<strong>${workspace_loc:/SampleProject/JSBuilder}</strong>&#8221; again without quotes. You could alternatively put an absolute path to the correct directory.</p>
<p><strong>Arguments:</strong></p>
<p>The arguments are the parameters you&#8217;d supply the batch file. You&#8217;ll need to remember to include a reference to the batch file here also. We do this like this:</p>
<p><strong>/C JSBuilder.bat -v -p &#8220;${workspace_loc:/SampleProject/build.jsb3}&#8221; -d &#8220;${workspace_loc:/SampleProject/deploy/}</strong></p>
<p>Again I&#8217;ve made use of the Variables but you could use absolute paths like so:</p>
<p><strong>/C JSBuilder.bat -v -p C:\Path\To\SampleProject\build.jsb3 -d C:\Path\To\SampleProject/deploy/</strong></p>
<p>Note that if you decide to use variables or spaces in your path names you&#8217;ll need to wrap the individual arguments in quotations. Also, you don&#8217;t need to put a quotation mark at the end of the arguments.</p>
<h2>Finally</h2>
<p>You can try your new External Tool by running it with &#8220;<strong>CTRL + B</strong>&#8220;. The console will open and hopefully you&#8217;ll get some nice output of your application building and finally a few files in your deploy directory for inclusion in your application.</p>
<p>Hope you&#8217;ve found this useful. If you have any questions or run into issues please leave a comment below. You&#8217;ll also find some interesting reading in the <a href="http://www.sencha.com/forum/forumdisplay.php?8-JS-Builder">JS Builder Forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.swarmonline.com/2011/02/how-to-integrate-js-builder-3-with-eclipse-or-aptana-on-windows/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

