<?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>Werx Limited &#187; extjs</title>
	<atom:link href="http://werxltd.com/wp/tag/extjs/feed/" rel="self" type="application/rss+xml" />
	<link>http://werxltd.com/wp</link>
	<description>We make IT work.</description>
	<lastBuildDate>Thu, 29 Jul 2010 19:00:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SOAPjr Demo</title>
		<link>http://werxltd.com/wp/2009/10/17/soapjr-demo/</link>
		<comments>http://werxltd.com/wp/2009/10/17/soapjr-demo/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 13:36:33 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[soapjr]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=230</guid>
		<description><![CDATA[A demo of SOAPjr using PHP/Symfony and ExtJS is now available at http://dev.communitybookshelf.org/ This demo showcases these custom components: Backend: pSOAPjr sfSOAPjrActionPlugin Frontend eSOAPjr Questions/comments? We&#8217;d love to hear from you!]]></description>
			<content:encoded><![CDATA[<p>A demo of <a href="http://soapjr.org/">SOAPjr</a> using <a href="http://php.net/">PHP</a>/<a href="http://www.symfony-project.org/">Symfony</a> and <a href="http://www.extjs.com/">ExtJS</a> is now available at <a href="http://dev.communitybookshelf.org/">http://dev.communitybookshelf.org/</a></p>
<p>This demo showcases these custom components:</p>
<ul>
<li>Backend:
<ul>
<li><a href="http://werxltd.com/wp/portfolio/psoapjr/">pSOAPjr</a></li>
<li><a href="http://werxltd.com/wp/portfolio/sfsoapjractionplugin/">sfSOAPjrActionPlugin</a></li>
</ul>
</li>
<li>Frontend
<ul>
<li><a href="http://werxltd.com/wp/portfolio/esoapjr/">eSOAPjr</a></li>
</ul>
</li>
</ul>
<p><a href="http://werxltd.com/wp/contact-us/">Questions/comments? We&#8217;d love to hear from you!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/10/17/soapjr-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Primitive OOP observer pattern with ExtJS</title>
		<link>http://werxltd.com/wp/2009/08/13/primitive-oop-with-extjs/</link>
		<comments>http://werxltd.com/wp/2009/08/13/primitive-oop-with-extjs/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 16:11:45 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[code quality]]></category>
		<category><![CDATA[coding practices]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[software design patterns]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=170</guid>
		<description><![CDATA[Recently I embarked on a quest to design a framework which would help us keep track of large and complex javascript projects in easily identifiable and extendable patterns. After some thought and deliberation, we eventually settled on the observer pattern using Ext&#8217;s Ext.util.Observable object as the base object to use in responding to event broadcasts [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I embarked on a quest to design a framework which would help us keep track of large and complex javascript projects in easily identifiable and extendable patterns. After some thought and deliberation, we eventually settled on the <a href="http://en.wikipedia.org/wiki/Observer_pattern">observer pattern</a> using Ext&#8217;s <a href="http://extjs.com/deploy/dev/docs/?class=Ext.util.Observable">Ext.util.Observable</a> object as the base object to use in responding to event broadcasts and the <a href="http://extjs.com/forum/showthread.php?t=37422">Ext.ux.BroadcastEvents</a> plugin for managing global event broadcasts.</p>
<p>Here is the code I came up with for common component elements:</p>
<pre class="brush:javascript">
ComponentWrapperBase = Ext.extend(Ext.util.Observable, {
	delayBuild: false,

	eventObj: {
			"buildwidget": true,
			"showwidget": true,
			"destroy": true,
			"refresh": true
		},

	globalEvents: [],

	widget: null,
	widgetCfg: null,

	build: function() {
		if (this.widgetCfg &#038;&#038; !this.widget) {
			//console.log("buildwidget", this);
			this.widget = Ext.ComponentMgr.create(this.widgetCfg);
			this.widget.wrapper = this;
			this.fireBuildEvent();
		}
	},

	fireBuildEvent: function() {
		this.fireEvent("buildwidget", this, this.widget);
	},

	showWidget: function(locationId) {
		if (this.widget) {
			if (this.widget.xtype == "window") {
					if (locationId != null) {
						this.widget.show(locationId);
					} else {
						this.widget.show();
					}
			}
			else {

				if (locationId != null) {
					this.widget.render(locationId);
				}
				else {
					this.widget.render();
				}
			}
			this.fireEvent("showwidget", this);
		}
	},

	constructor: function(config){
		if (config) {
			if (config.widgetCfg) {
				this.widgetCfg = config.widgetCfg;
			}

			if (config.delayBuild) {
				this.delayBuild = config.delayBuild;
			}

			// Copy configured listeners into *this* object so that the base class's
			// constructor will add them.
			if (config.listeners) {
				Ext.apply(this.listeners,config.listeners);
			}

			if(config.events &#038;&#038; Ext.isArray(config.events)) {
				for (var i=0; i<config.events.length; i++) {
					this.eventObj[config.events[i]] = true;
				};
			}

			if (config.globalEvents &#038;&#038; Ext.isArray(config.globalEvents)) {
				this.globalEvents = config.globalEvents;
			}
		}

		for (var i=0; i
<this.globalEvents.length; i++) {
			Ext.ux.event.Broadcast.subscribe(this.globalEvents[i], this.listeners[this.globalEvents[i]], this);
			this.eventObj[this.globalEvents[i]] = true;
		};

		this.addEvents(this.eventObj);

		// Call our superclass constructor to complete construction process.
		ComponentWrapperBase.superclass.constructor.call(this);

		//this.on(this.eventListeners);

		if(!this.delayBuild) {
			this.build();
		}
	}
});
</pre>
<p>This creates a simple widget wrapped in an Observable object. You can reach the contained widget through wrapper.widget. Using the framework above, here's how you could create a simple widget.</p>
<pre class="brush:javascript">
SimpleTextField = Ext.extend(ComponentWrapperBase, {
	widgetCfg: {
		xtype: 'textfield',
		fieldLabel: 'Name'
	},
	constructor: function(config){		// Constructor is not required, but I've included
							// it to demonstrate the flexibility of this framework
		if (config) {
			Ext.apply(this,config);
		}

		this.widgetCfg.value = 'John Smith';

		SimpleTextField.superclass.constructor.call(this);
	}
});

var simpleTextField = new SimpleTextField();
// Actual component is available at simpleTextField.widget, useful for adding to other containers
</pre>
<p>That's it! If you have any questions or comments, feel free to post them below.</p>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/08/13/primitive-oop-with-extjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cleaning up unresponsive script errors</title>
		<link>http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/</link>
		<comments>http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 18:58:13 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascript optimization]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[unresponsive script error]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=85</guid>
		<description><![CDATA[I recently worked on improving performance in a labor scheduling application. The app was originally designed to load all the employees at one time in one large chunk, processing and stuffing the data into various places as needed on startup. This all worked fairly well on average stores with 50-100 employee records until we discovered [...]]]></description>
			<content:encoded><![CDATA[<p>I recently worked on improving performance in a labor scheduling application. The app was originally designed to load all the employees at one time in one large chunk, processing and stuffing the data into various places as needed on startup. This all worked fairly well on average stores with 50-100 employee records until we discovered several stores with 100+ employee records which caused the browser to display an <a href="http://somewhatfrank.typepad.com/photos/uncategorized/yahoo_unresponsive_script_1.jpg">unresponsive script warning</a> due to the rather heavy pre-processing algorithms.</p>
<p>After scouring the web for clues to help me get rid of this warning without <a href="http://lifehacker.com/162574/put-off-firefox-15s-unresponsive-script-dialogue">changing settings</a> on the browser, I found out that the only way to avoid these warnings was through a pseudo-threading pattern using setTimeout<sup>1</sup><sup>2</sup>.</p>
<p>One of the patterns I came up with to process a sequence of commands (such as adding records to a store) one at a time while still allowing the browser time to refresh and process other commands:</p>
<pre class="brush:javascript">var chainedTasks = [
   function() {
      console.log('first set of tasks');
   },
   function() {
      console.log('second set of tasks');
   },
   function() {
      console.log('third set of tasks');
   }
];

var currentTaskNum = 0;
var isExecuting = false;
var emptask = {var emptask = {
	scope: this,
	interval: 100,
	run: function(){
		if(currentTaskNum &gt; chainedTasks.length) {
			Ext.TaskMgr.stop(emptask);
		}

		if (!threadIsRunning) {
			threadIsRunning = true;
			if (typeof chainedTasks[currentTaskNum] === 'function') {
				chainedTasks[currentTaskNum](currentTaskNum);
			}
			currentTaskNum++;
			threadIsRunning = false;
		}
	}
};
Ext.TaskMgr.start(emptask);</pre>
<ol class="footnotes"><li id="footnote_0_85" class="footnote"><a href="http://www.dojotoolkit.org/forum/support/general-support/need-suggestions-how-manage-firefox-warning-unresponsive-script">http://www.dojotoolkit.org/forum/support/general-support/need-suggestions-how-manage-firefox-warning-unresponsive-script</a></li><li id="footnote_1_85" class="footnote"><a href="http://dev.opera.com/articles/view/efficient-javascript/?page=all">http://dev.opera.com/articles/view/efficient-javascript/?page=all</a></li></ol>]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExtJS resources</title>
		<link>http://werxltd.com/wp/2009/07/01/extjs-resources/</link>
		<comments>http://werxltd.com/wp/2009/07/01/extjs-resources/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 20:20:15 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=78</guid>
		<description><![CDATA[For what it&#8217;s worth, here are some ExtJS specific resources  I&#8217;ve found helpful: ExtJS Official Website, specifically the forum, API, and examples pages ExtJS UX repository for plugins Saki&#8217;s Extensions ExtJS GUI Builder]]></description>
			<content:encoded><![CDATA[<p>For what it&#8217;s worth, here are some ExtJS specific resources  I&#8217;ve found helpful:</p>
<ul>
<li><a href="http://extjs.com/">ExtJS Official Website</a>, specifically the <a href="http://extjs.com/forum/">forum</a>, <a href="http://extjs.com/deploy/dev/docs/">API</a>, and <a href="http://extjs.com/deploy/dev/examples/samples.html">examples</a> pages</li>
<li><a href="http://extjs-ux.org/docs/">ExtJS UX repository</a> for plugins</li>
<li><a href="http://extjs.eu/">Saki&#8217;s Extensions</a></li>
<li><a style="text-decoration: none;" href="http://tof2k.com/ext/formbuilder/">ExtJS GUI Builder</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/07/01/extjs-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi-threading in Web 2.0</title>
		<link>http://werxltd.com/wp/2009/06/10/multi-threading-in-web-20/</link>
		<comments>http://werxltd.com/wp/2009/06/10/multi-threading-in-web-20/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 19:21:22 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[multi threading]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=54</guid>
		<description><![CDATA[I've been tasked with speeding up a web 2.0 application based on ExtJS 2.2.0 that contains several routines that take up quite a bit of time and, because IE6's javascript processing engine is less than stellar ((In other words, it sucks pretty bad.)), I needed to find a way to "speed things up".]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been tasked with speeding up a web 2.0 application based on ExtJS 2.2.0 that contains several routines that take up quite a bit of time and, because <a href="http://technologytales.com/2007/06/22/ie6-and-javascript-performance/">IE6&#8242;s javascript processing engine is less than stellar</a><sup>1</sup>, I needed to find a way to &#8220;speed things up&#8221;.</p>
<p>Enter <a href="http://extjs.com/deploy/dev/docs/?class=Ext.TaskMgr">Ext.TaskMgr</a>, a helpful ExtJS object that is essentially a glorified <a href="http://www.w3schools.com/htmldom/met_win_settimeout.asp">setTimeout</a> implementation that allows us to run tasks that don&#8217;t block execution. This means we can set our more expensive blocks of code to run later but return control back to the user in the meantime. It&#8217;s not true multi-threading, but it does allow us to make the user interface a lot more responsive and in an age when users think 5 seconds is an eternity, <a href="http://msdn.microsoft.com/en-us/library/bb288452.aspx">perception is everything</a>.</p>
<ol class="footnotes"><li id="footnote_0_54" class="footnote">In other words, it sucks pretty bad.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/06/10/multi-threading-in-web-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How many Mondays are in the month of&#8230;</title>
		<link>http://werxltd.com/wp/2009/05/20/how-many-mondays-are-in-the-month-of/</link>
		<comments>http://werxltd.com/wp/2009/05/20/how-many-mondays-are-in-the-month-of/#comments</comments>
		<pubDate>Wed, 20 May 2009 20:02:13 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=21</guid>
		<description><![CDATA[I recently ran into a situation where I needed to know how many Monday&#8217;s were in a given month via javascript and figured I would make the function (which depends on Date extensions by ExtJS) for it available here in case anyone else runs into the same problem. /* * This function takes a date [...]]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a situation where I needed to know how many Monday&#8217;s were in a given month via javascript and figured I would make the function (which depends on <a href="http://extjs.com/deploy/dev/docs/?class=Date">Date</a> extensions by <a href="http://extjs.com">ExtJS</a>) for it available here in case anyone else runs into the same problem.</p>
<pre class="brush:javascript">/*
 * This function takes a date and determines how many of each day of the week
 * are in the month.
 */
var getMonthlyDayOfWeekCount = function(sourceDate){
    var iDate = Date.parseDate(sourceDate.format('m') + '/1/' + sourceDate.format('Y'), 'm/j/Y');
    var days = [0, 0, 0, 0, 0, 0, 0];

    while (iDate.format('m') == sourceDate.format('m')) {
        days[iDate.format('w')]++;
        iDate = iDate.add(Date.DAY, 1);
    }

    return days;
};

/*
 * This function takes a date and returns an interger cotnaining the
 * occurance of this day in the month.
 *
 * Useful for when you want to know if this is the 1st or 3rd Saturday in
 * the month.
 */
var getDayInMonthCount = function(sourceDate){
    var iDate = Date.parseDate(sourceDate.format('m') + '/1/' + sourceDate.format('Y'), 'm/j/Y');
    count = 1;

    while (iDate.format('m') == sourceDate.format('m')) {
        if (iDate.format('z Y') == sourceDate.format('z Y')) {
            return count;
        }

        if (iDate.format('w') == sourceDate.format('w')) {
            count++;
        }
        iDate = iDate.add(Date.DAY, 1);
    }

    return count;
};</pre>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/05/20/how-many-mondays-are-in-the-month-of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
