<?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>Mon, 23 Jan 2012 23:03:59 +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>Simple message bus for extjs 4</title><link>http://werxltd.com/wp/2011/04/05/simple-message-bus-for-extjs-4/</link> <comments>http://werxltd.com/wp/2011/04/05/simple-message-bus-for-extjs-4/#comments</comments> <pubDate>Tue, 05 Apr 2011 18:52:54 +0000</pubDate> <dc:creator>wes</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[extjs]]></category> <category><![CDATA[sencha]]></category><guid
isPermaLink="false">http://werxltd.com/wp/?p=928</guid> <description><![CDATA[Here&#8217;s a simple message bus/broker I wrote for Ext.js 4 Ext.define('Ext.ux.MessageBroker', { extend: 'Ext.util.Observable', statics: { instance: null, setInstance: function(i) { this.instance = i; }, sendMessage: function(msg, data) { this.fireEvent('message',{"msg":msg,"data":data}); } }, constructor: function(config){ this.addEvents({ "message" : true }); if(config &#038;&#038; config.listeners) this.listeners = config.listeners; Ext.ux.MessageBroker.superclass.constructor.call(this, config) } }, function() { Ext.ux.MessageBroker.setInstance(new Ext.ux.MessageBroker()); }); // [...]]]></description> <content:encoded><![CDATA[<p>Here&#8217;s a simple message bus/broker I wrote for Ext.js 4</p><pre class="brush:javascript">
Ext.define('Ext.ux.MessageBroker', {
    extend: 'Ext.util.Observable',

    statics: {
        instance: null,
        setInstance: function(i) {
            this.instance = i;
        },
        sendMessage: function(msg, data) {
            this.fireEvent('message',{"msg":msg,"data":data});
        }
    },

    constructor: function(config){
        this.addEvents({
            "message" : true
        });

        if(config &#038;&#038; config.listeners) this.listeners = config.listeners;

        Ext.ux.MessageBroker.superclass.constructor.call(this, config)
    }

}, function() {
    Ext.ux.MessageBroker.setInstance(new Ext.ux.MessageBroker());
});

// Sending a message:
Ext.ux.MessageBroker.sendMessage("load_stock", {"symbol":"INTC"});

// Recieving a message:
Ext.util.Observable.observe(Ext.ux.MessageBroker);
Ext.ux.MessageBroker.on('message', function(msg) {
    console.log('message fired: ',msg);
});
</pre><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;count=none&amp;text=Simple%20message%20bus%20for%20extjs%204" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;count=none&amp;text=Simple%20message%20bus%20for%20extjs%204" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;linkname=Simple%20message%20bus%20for%20extjs%204" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2011%2F04%2F05%2Fsimple-message-bus-for-extjs-4%2F&amp;title=Simple%20message%20bus%20for%20extjs%204" id="wpa2a_2">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2011/04/05/simple-message-bus-for-extjs-4/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <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! No related content found.]]></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><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;count=none&amp;text=SOAPjr%20Demo" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;count=none&amp;text=SOAPjr%20Demo" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;linkname=SOAPjr%20Demo" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F10%2F17%2Fsoapjr-demo%2F&amp;title=SOAPjr%20Demo" id="wpa2a_4">Share/Save</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><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;count=none&amp;text=Primitive%20OOP%20observer%20pattern%20with%20ExtJS" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;count=none&amp;text=Primitive%20OOP%20observer%20pattern%20with%20ExtJS" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;linkname=Primitive%20OOP%20observer%20pattern%20with%20ExtJS" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F08%2F13%2Fprimitive-oop-with-extjs%2F&amp;title=Primitive%20OOP%20observer%20pattern%20with%20ExtJS" id="wpa2a_6">Share/Save</a></p>]]></content:encoded> <wfw:commentRss>http://werxltd.com/wp/2009/08/13/primitive-oop-with-extjs/feed/</wfw:commentRss> <slash:comments>1</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://werxltd.com/wp/wp-content/uploads/2009/07/yahoo_unresponsive_script_1.jpg?9d7bd4">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><a
href="http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/#footnote_0_85" id="identifier_0_85" class="footnote-link footnote-identifier-link" title="http://www.dojotoolkit.org/forum/support/general-support/need-suggestions-how-manage-firefox-warning-unresponsive-script">1</a></sup><sup><a
href="http://werxltd.com/wp/2009/07/03/cleaning-up-unresponsive-script-errors/#footnote_1_85" id="identifier_1_85" class="footnote-link footnote-identifier-link" title="http://dev.opera.com/articles/view/efficient-javascript/?page=all">2</a></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><div
class="betterrelated none"><p>No related content found.</p></div><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><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;count=none&amp;text=Cleaning%20up%20unresponsive%20script%20errors" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;count=none&amp;text=Cleaning%20up%20unresponsive%20script%20errors" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;linkname=Cleaning%20up%20unresponsive%20script%20errors" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F03%2Fcleaning-up-unresponsive-script-errors%2F&amp;title=Cleaning%20up%20unresponsive%20script%20errors" id="wpa2a_8">Share/Save</a></p>]]></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 No related content found.]]></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><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;count=none&amp;text=ExtJS%20resources" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;count=none&amp;text=ExtJS%20resources" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;linkname=ExtJS%20resources" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F07%2F01%2Fextjs-resources%2F&amp;title=ExtJS%20resources" id="wpa2a_10">Share/Save</a></p>]]></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><a
href="http://werxltd.com/wp/2009/06/10/multi-threading-in-web-20/#footnote_0_54" id="identifier_0_54" class="footnote-link footnote-identifier-link" title="In other words, it sucks pretty bad.">1</a></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><div
class="betterrelated none"><p>No related content found.</p></div><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><div
class="betterrelated none"><p>No related content found.</p></div><p><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;count=none&amp;text=How%20many%20Mondays%20are%20in%20the%20month%20of%26%238230%3B" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;counturl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;count=none&amp;text=How%20many%20Mondays%20are%20in%20the%20month%20of%26%238230%3B" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe
frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe
class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><a
class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;linkname=How%20many%20Mondays%20are%20in%20the%20month%20of%26%238230%3B" title="LinkedIn" rel="nofollow" target="_blank"><img
src="http://werxltd.com/wp/wp-content/plugins/add-to-any/icons/linkedin.png?9d7bd4" width="16" height="16" alt="LinkedIn"/></a><a
class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwerxltd.com%2Fwp%2F2009%2F05%2F20%2Fhow-many-mondays-are-in-the-month-of%2F&amp;title=How%20many%20Mondays%20are%20in%20the%20month%20of%26%238230%3B" id="wpa2a_12">Share/Save</a></p>]]></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>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 2/25 queries in 0.517 seconds using apc
Object Caching 746/790 objects using apc

Served from: werxltd.com @ 2012-02-05 02:39:08 -->
