<?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>Fusioncube</title>
	<atom:link href="http://www.fusioncube.net/index.php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.fusioncube.net</link>
	<description>The online journey of a technophile, by Steve Brownlee</description>
	<lastBuildDate>Tue, 31 Aug 2010 13:34:30 +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>Sencha ExtJS: WordWrapColumnModel to word wrap in a GridPanel</title>
		<link>http://www.fusioncube.net/index.php/sencha-extjs-wordwrapcolumnmodel-to-word-wrap-in-a-gridpanel</link>
		<comments>http://www.fusioncube.net/index.php/sencha-extjs-wordwrapcolumnmodel-to-word-wrap-in-a-gridpanel#comments</comments>
		<pubDate>Tue, 31 Aug 2010 13:33:49 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[errata]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/index.php/sencha-extjs-wordwrapcolumnmodel-to-word-wrap-in-a-gridpanel</guid>
		<description><![CDATA[I&#8217;ve got an application that displays user notes in a GridPanel. These notes tend to be very long, but the default style for a cell is white-space: nowrap, which prevents word wrapping the contents. Sometimes simply expanding the column in the UI is enough, but if the note is long enough, it&#8217;s a clumsy fix. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got an application that displays user notes in a GridPanel. These notes tend to be very long, but the default style for a cell is <strong>white-space: nowrap</strong>, which prevents word wrapping the contents. Sometimes simply expanding the column in the UI is enough, but if the note is long enough, it&#8217;s a clumsy fix.</p>
<p>I decided to extend the standard ColumnModel class to automatically wrap all cells in the grid, unless overridden (see below).</p>
<h3>WordWrapColumnModel</h3>
<pre class="code"><code>Ext.grid.WordWrapColumnModel = Ext.extend(Ext.grid.ColumnModel, {

   initComponent: function(){
      Ext.grid.WordWrapColumnModel.superclass.initComponent.apply(this, arguments);
   },

   getRenderer : function(col){
      if(!this.config[col].renderer){
         if (typeof(this.config[col].wordWrap)=='undefined' || this.config[col].wordWrap==true){
            return Ext.grid.ColumnModel.wordWrapRenderer;
         } else {
            return Ext.grid.ColumnModel.defaultRenderer;
         }
      }
      return this.config[col].renderer;
   },

   onRender: function(){
      Ext.grid.WordWrapColumnModel.superclass.onRender.apply(this, arguments);
   }
});

Ext.grid.ColumnModel.wordWrapRenderer = function(value){
    return '&amp;lt;div style=&amp;quot;white-space:normal !important;&amp;quot;&amp;gt;' + value + '&amp;lt;/div&amp;gt;';
};

Ext.reg('wordwrapcolumnmodel', Ext.grid.WordWrapColumnModel);</code></pre>
<h3>Usage</h3>
<p>By using this column model class, all columns will, by default, wrap their text if the text length is greater than the width of the column. You can override this if you want any of the columns to not wrap by specifying the <strong>wordWrap: false</strong> config option.</p>
<pre class="code"><code>var NoteColumnModel = new Ext.grid.WordWrapColumnModel([{
       id        : 'first_name',
       header    : 'First Name',
       dataIndex : 'first_name',
       width     : 100
    },{
       id        : 'last_name',
       header    : 'Last Name',
       dataIndex : 'last_name',
       width     : 100,
       wordWrap  : false
    },{
       id        : 'setup_date',
       header    : 'Created',
       dataIndex : 'setup_date',
       width     : 100
    },{
       id        : 'note_txt',
       header    : 'Note Text',
       dataIndex : 'note_txt',
       width     : 600
    }
]);</code></pre>
<p><a href="http://www.fusioncube.net/wp-content/uploads/2010/08/clip_image0016.png"><img title="clip_image001[6]" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="208" alt="clip_image001[6]" src="http://www.fusioncube.net/wp-content/uploads/2010/08/clip_image0016_thumb.png" width="544" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/sencha-extjs-wordwrapcolumnmodel-to-word-wrap-in-a-gridpanel/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Where&#8217;s the &#8220;Stop Growing Up&#8221; button?</title>
		<link>http://www.fusioncube.net/index.php/wheres-the-stop-growing-up-button</link>
		<comments>http://www.fusioncube.net/index.php/wheres-the-stop-growing-up-button#comments</comments>
		<pubDate>Mon, 30 Aug 2010 17:11:56 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[family]]></category>
		<category><![CDATA[fatherhood]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/index.php/wheres-the-stop-growing-up-button</guid>
		<description><![CDATA[My shining star needs to stop growing up on me! These days, I wish kids came with a Stop Growing Up button that I can push anytime I want so that I can enjoy the little things that come with each new phase of their lives. Beach Trip 2007 Beach Trip 2010]]></description>
			<content:encoded><![CDATA[<p>My shining star needs to stop growing up on me! These days, I wish kids came with a <em>Stop Growing Up</em> button that I can push anytime I want so that I can enjoy the little things that come with each new phase of their lives.</p>
<p><strong>Beach Trip 2007</strong></p>
<p><a href="http://www.fusioncube.net/wp-content/uploads/2010/08/image.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="image" src="http://www.fusioncube.net/wp-content/uploads/2010/08/image_thumb.png" width="187" border="0" /></a> </p>
<p><strong>Beach Trip 2010</strong></p>
<p><a href="http://www.fusioncube.net/wp-content/uploads/2010/08/image1.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="image" src="http://www.fusioncube.net/wp-content/uploads/2010/08/image_thumb1.png" width="161" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/wheres-the-stop-growing-up-button/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to define a function</title>
		<link>http://www.fusioncube.net/index.php/how-to-define-a-function</link>
		<comments>http://www.fusioncube.net/index.php/how-to-define-a-function#comments</comments>
		<pubDate>Thu, 12 Aug 2010 17:16:27 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[errata]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[conventions]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/?p=980</guid>
		<description><![CDATA[I was writing some code this morning for a demo application, and I kept getting an error in one part of my Flex code and I just couldn’t figure out what the hell was going on. Turned out, it was a symptom of how many different function declaration conventions I have to deal with. It [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing some code this morning for a demo application, and I kept getting an error in one part of my Flex code and I just couldn’t figure out what the hell was going on. Turned out, it was a symptom of how many different function declaration conventions I have to deal with.</p>
<p>It got me thinking about how many different ways do I write a function in one day. Let’s see…</p>
<pre class="code"><code>-=  Java and C#  =-
public &lt;type&gt; myFunction([args])...

-=  Javascript  =-
function myFunction([args])...

-=  ColdFusion  =-
public &lt;type&gt; function myFunction([args])...

-=  Flex  =-
public function myFunction([args]):&lt;type&gt;</code></pre>
<p>No wonder I confused from time to time.</p>
<p><br/><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/how-to-define-a-function/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I&#8217;ll take the technology behind door #3, Bob!</title>
		<link>http://www.fusioncube.net/index.php/ill-take-the-technology-behind-door-3-bob</link>
		<comments>http://www.fusioncube.net/index.php/ill-take-the-technology-behind-door-3-bob#comments</comments>
		<pubDate>Mon, 02 Aug 2010 15:16:21 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[errata]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/index.php/ill-take-the-technology-behind-door-3-bob</guid>
		<description><![CDATA[It’s been a bit hectic at work in the last 2 years. Well, perhaps hectic isn’t the perfect word, but it’s close. Since I started working here, we’ve gone through two complete development technology stack switches. Back in the halcyon days of 2007, I had the unenviable task of shoring up some very hastily written [...]]]></description>
			<content:encoded><![CDATA[<p>It’s been a bit hectic at work in the last 2 years. Well, perhaps hectic isn’t the perfect word, but it’s close. Since I started working here, we’ve gone through two complete development technology stack switches.</p>
<p>Back in the halcyon days of 2007, I had the unenviable task of shoring up some very hastily written applications (by database developers and a couple of hacks who were here before me) using ColdFusion and HTML/Javascript. I beefed up the corporate offerings by implementing industry-accepted practices and patterns, used well-established libraries and got upgrades to the ColdFusion servers.</p>
<p>Then, in late 2008, the decision was made to scrap any future development of HTML/Javascript user interfaces and use Flex instead. That was exciting because of two reasons:</p>
<ul>
<li><font color="#444640">I got to learn a cool technology like Flex</font> </li>
<li><font color="#444640">I didn’t have to port any of my existing ColdFusion code to another language.</font> </li>
</ul>
<p><font color="#4c4c4c">Fast forward to 2010 and now the entire company is rolling over to the .NET stack. Now I get to brush up on my rusty C# skills which I haven’t used in almost 4 years; I get to learn the ASP.NET MVC architecture; I get to have fun learning how to connect our .NET applications to our Oracle databases; lastly, I get to estimate how long it would take to convert our entire ColdFusion code base to .NET.</font></p>
<p><font color="#4c4c4c">I’ll still get to work in ColdFusion from time to time, but .NET is the future…. for now.&#160; Perhaps 2012 will be the year we convert everything to Java!</font></p>
<p><font color="#4c4c4c">I’m all for rolling with the punches and evolving my skill set to match what is needed for the organization to be successful, but I’m also no longer 24 years old with oodles of free time at my disposal (or the accompanying mental agility). Doing these massive switches takes a little more time at my venerable age.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/ill-take-the-technology-behind-door-3-bob/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sencha ExtJS 3.3 Beta Announced</title>
		<link>http://www.fusioncube.net/index.php/sencha-extjs-3-3-beta-announced</link>
		<comments>http://www.fusioncube.net/index.php/sencha-extjs-3-3-beta-announced#comments</comments>
		<pubDate>Fri, 30 Jul 2010 13:08:08 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Sencha]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[actioncolumn]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[event handler]]></category>
		<category><![CDATA[pivotgrid]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/index.php/sencha-extjs-3-3-beta-announced</guid>
		<description><![CDATA[I was browsing around the Sencha site this morning and saw that they announced the beta release of 3.3 which includes two major new components: PivotGrids Calendar While those will garner much attention, the ugly stepchild mentioned at the bottom of the press release is also very cool. The ActionColumn allows you to put icons [...]]]></description>
			<content:encoded><![CDATA[<p>I was browsing around the Sencha site this morning and saw that they <a href="http://www.sencha.com/blog/2010/07/28/announcing-ext-js-3-3-beta-pivotgrids-calendars-and-more/" target="_blank">announced the beta release of 3.3</a> which includes two major new components: </p>
<ul>
<li><a href="http://www.sencha.com/deploy/ext-3.3-beta1-6976/examples/pivotgrid/simple.html" target="_blank">PivotGrids</a> </li>
<li><a href="http://www.sencha.com/deploy/ext-3.3-beta1-6976/examples/calendar/index.html" target="_blank">Calendar</a> </li>
</ul>
<p>While those will garner much attention, the ugly stepchild mentioned at the bottom of the <a href="http://www.sencha.com/blog/2010/07/28/announcing-ext-js-3-3-beta-pivotgrids-calendars-and-more/" target="_blank">press release</a> is also very cool. The <a href="http://www.sencha.com/deploy/ext-3.3-beta1-6976/examples/grid/array-grid.html" target="_blank">ActionColumn</a> allows you to put icons inside a grid with an accompanying event handler.</p>
<p>This is something we use quite a bit in Flex, and its addition to ExtJS is exciting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/sencha-extjs-3-3-beta-announced/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My passion no longer takes up all my time</title>
		<link>http://www.fusioncube.net/index.php/my-passion-no-longer-takes-up-all-my-time</link>
		<comments>http://www.fusioncube.net/index.php/my-passion-no-longer-takes-up-all-my-time#comments</comments>
		<pubDate>Wed, 28 Jul 2010 17:14:24 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[family]]></category>
		<category><![CDATA[fatherhood]]></category>
		<category><![CDATA[kids]]></category>
		<category><![CDATA[passion]]></category>
		<category><![CDATA[raising children]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/index.php/my-passion-no-longer-takes-up-all-my-time</guid>
		<description><![CDATA[I’ll admit that I’m very fortunate. I work in a field that is my true passion.&#160; I am a technologist, and more specifically, a software architect. I also work for a great company that allows me to be creative, efficient, and impactful. However, a recent article I read just made me realize that my passion [...]]]></description>
			<content:encoded><![CDATA[<p>I’ll admit that I’m very fortunate. I work in a field that is my true passion.&#160; I am a technologist, and more specifically, a software architect. I also work for a great company that allows me to be creative, efficient, and impactful.</p>
<p>However, a recent article I read just made me realize that my passion has been eaten away by something else.</p>
<p>I used to work late… just because. If I was working on some particularly hairy algorithm, or software problem, I would work until it was complete. I got a rush out of it, and a deep sense of satisfaction that I could turn something complex into something elegantly simple.</p>
<p>I would go home and read technical books, online articles, and samples about up-and-coming languages or tools. I would be constantly writing sample applications in new languages, or playing around with a new database schema editor or programming environment. I would also join discussion groups, and attend local user group meetings just to meet and talk with people who shared my passion.</p>
<p>Most of that is gone now.</p>
<p>Now, my overriding thought is my two girls. They are my passion. Growing up and in my early adulthood, I knew I wanted a family and wanted to be the best father I could be. I thought about how I would raise my children to be competent, intelligent, resourceful adults.</p>
<p>Now that I am actually a father, I’ve realized two things:</p>
<ol>
<li><font color="#444640">Even though I knew it would be a lot of work, I had no idea how much work is involved in raising children.</font></li>
<li><font color="#444640">I love it. I truly feel like I was made to be a father to my kids. Yeah it’s hard work, but I love every funny, whiny, screaming, giggling, sticky-fingered, cuddly, exasperating, exhausting, exhilarating minute of it.</font></li>
</ol>
<p>Gone are the days of coming home and reading books and magazines about technology. Now I come home and am welcomed by two little girls who scream, “Daddy!! You’re home!!” and want hugs and kisses.</p>
<p>How can you not be passionate about that?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/my-passion-no-longer-takes-up-all-my-time/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Social Media Bollocks!</title>
		<link>http://www.fusioncube.net/index.php/social-media-bollocks</link>
		<comments>http://www.fusioncube.net/index.php/social-media-bollocks#comments</comments>
		<pubDate>Fri, 23 Jul 2010 15:07:08 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[errata]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[ninja]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/index.php/social-media-bollocks</guid>
		<description><![CDATA[A few weeks ago I was at a gathering of like-minded technologists in my area, and I struck up a quick (thankfully) conversation with a fellow who, in all seriousness, labeled himself a Social Media Ninja. He just let it hang there for a second, waiting for the expected, and inevitable, question, “What is a [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I was at a gathering of like-minded technologists in my area, and I struck up a quick (thankfully) conversation with a fellow who, in all seriousness, labeled himself a Social Media Ninja. He just let it hang there for a second, waiting for the expected, and inevitable, question, “What is a Social Media Ninja?”</p>
<p>I’ll do my best to correctly paraphrase his response.</p>
<p>Apparently, a Social Media Ninja is someone who has 5000 followers on their Twitter account, shares links to articles that <strong>other</strong> people post throughout the day, and has an active Facebook fan page.</p>
<p>Huh.</p>
<p>So I guess my 15-year-old niece is a Social Media Ninja. Perhaps she should be out there trying to get the same jobs that this tool &#8211; I mean Ninja &#8211; is trying to procure.</p>
<p>Not once did he talk about how these amazing, super-human like powers could possibly help a business retain, or gain, customers. He failed to mention that he could affect a company’s revenue stream in any way shape or form. Apparently he just wants someone to hire him so that he can create a Twitter account, and a Facebook fan page and sit there and talk to people all day.</p>
<p>No strategy. No plan. Sorry, that means no results.</p>
<p>However, he does have something cool to put on his business cards.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/social-media-bollocks/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Sencha ExtJS: Allow users to find without searching in a ComboBox</title>
		<link>http://www.fusioncube.net/index.php/sencha-extjs-allow-users-to-find-without-searching-in-a-combobox</link>
		<comments>http://www.fusioncube.net/index.php/sencha-extjs-allow-users-to-find-without-searching-in-a-combobox#comments</comments>
		<pubDate>Wed, 21 Jul 2010 14:23:10 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[cancel query]]></category>
		<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[enableKeyEvents]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[keypress]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/?p=929</guid>
		<description><![CDATA[In an ExtJS ComboBox, it’s fairly easy to implement a search feature where given the user’s entry, you can return a list of possible matches. I outline this mechanism in Sencha ExtJS: Simple Autocomplete Example. However, recent user feedback was, “If I know the unit I’m looking for, why can’t I just type it in [...]]]></description>
			<content:encoded><![CDATA[<p>In an ExtJS ComboBox, it’s fairly easy to implement a search feature where given the user’s entry, you can return a list of possible matches. I outline this mechanism in <a href="http://www.fusioncube.net/index.php/ext-simple-autocomplete-example" target="_blank">Sencha ExtJS: Simple Autocomplete Example</a>.</p>
<p>However, recent user feedback was, “If I know the unit I’m looking for, why can’t I just type it in and hit ENTER and skip the whole search feature to find the one I need?”</p>
<p>Doh.</p>
<p>Yes, I was making the users wait – even if for 1 second – for a list of possible matches to be displayed, when 90% of the time they know which one they want to open.</p>
<p>Luckily, I was able to briefly look at the documentation for ComboBox and find out how to accomplish this. You need to set the enableKeyEvents config property to true, and then hook into the keypress event and check for the user pressing the ENTER (or RETURN) key. When the ENTER key is pressed, prevent the query from being executed, and open the item the user entered.</p>
<pre class="code"><code>var WidgetSearch = new Ext.form.ComboBox({
    minChars:           3,
    loadingText:        '',
    itemSelector:       'div.search-item',
    triggerClass:       'x-form-search-trigger',
    applyTo:            'search-field',
    <strong>enableKeyEvents:  true,</strong>
    store: new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({url: 'widgets.cfm'}),
        reader: new Ext.data.JsonReader({
            root:           'data',
            totalProperty:  'recordcount'
        }, [
            {name: 'widget_number', type: 'string'},
            {name: 'widget_name', type: 'string'}
        ])
    }),
    tpl: new Ext.XTemplate(
        '&lt;tpl for="."&gt;&lt;div class="search-item"&gt;',
            '{widget_number} - {widget_name}',
        '&lt;/div&gt;&lt;/tpl&gt;'
    ),
    onSelect: function(record){
        document.location.href = 'displayWidgetDetails.cfm&amp;amp;wid=' + record.data.widget_number;
    },
    listeners:
    {
        // Hook into the keypress event to detect if the user pressed the ENTER key
        keypress: function(comboBox, e){
            if (e.getCharCode() == e.ENTER) {
                // Prevent the default query action since the user
                // believes she has entered a proper widget number
                comboBox.on('beforequery', function(q){q.cancel=true;},this);

                // Redirect browser to widget detail view
                document.location.href = 'displayWidgetDetails.cfm&amp;amp;wid=' + WidgetSearch.getValue();
            }
        }
    }
});</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/sencha-extjs-allow-users-to-find-without-searching-in-a-combobox/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Managing dirty rows in a Sencha ExtJS EditorGridPanel</title>
		<link>http://www.fusioncube.net/index.php/managing-dirty-rows-in-a-sencha-extjs-editorgridpanel</link>
		<comments>http://www.fusioncube.net/index.php/managing-dirty-rows-in-a-sencha-extjs-editorgridpanel#comments</comments>
		<pubDate>Tue, 20 Jul 2010 20:07:21 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[datagrid]]></category>
		<category><![CDATA[dirty data]]></category>
		<category><![CDATA[Sencha]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/index.php/managing-dirty-rows-in-a-sencha-extjs-editorgridpanel</guid>
		<description><![CDATA[A Sencha ExtJS EditorGridPanel automatically visually marks a cell as dirty when a user modifies the value, but that’s it. If you want to know if a row is dirty and take an action based upon that knowledge, you’re on your own. Since I needed this functionality, I took a stab at it today, and [...]]]></description>
			<content:encoded><![CDATA[<p>A Sencha ExtJS EditorGridPanel automatically visually marks a cell as dirty when a user modifies the value, but that’s it. If you want to know if a row is dirty and take an action based upon that knowledge, you’re on your own.</p>
<p>Since I needed this functionality, I took a stab at it today, and here’s my simplistic example of how to do it.</p>
<p>First, I create a global variable named editedRow which will get updated when the afteredit event is fired on the GridPanel.</p>
<pre class="code"><code>var editedRow;

var AutoGrid = new Ext.grid.EditorGridPanel({
    // Properties clipped for article;
    // view example for full code
});

// After any field is edited, make the row dirty
AutoGrid.on('afteredit', function(){
    if (!editedRow){
        editedRow = AutoGrid.getSelectionModel().getSelections();
    }
}, this);</code></pre>
<p>Now that I’ve stored which row is dirty, every time the user clicks on another cell, I check a) there is a dirty row, and b) if the active row is the dirty row.</p>
<pre class="code"><code>// Any time the user mouse downs on a cell,
// check to see if there are any dirty rows
AutoGrid.on('cellmousedown', checkForChanges, this);

function checkForChanges(){
    if (!editedRow){
        return true;      // No dirty rows
    } else {
        var selectedRow = AutoGrid.getSelectionModel().getSelections();
        var selectedRecord = selectedRow[0].data;
        var editedRecord;

        editedRecord = editedRow[0].data;

        if (selectedRecord.model != editedRecord.model){
            // Alert the user to save changes
            // See example for full code
        }
    }
}</code></pre>
<p>Then if there is a dirty row, I can prompt the user and ask it to save its changes before editing another row.</p>
<p><a href="http://www.fusioncube.net/examples/dirtyRow.html" target="_blank">View Dirty Row Example</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/managing-dirty-rows-in-a-sencha-extjs-editorgridpanel/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sencha ExtJS ComboBox.selectedValue() equivalent for DataGrid</title>
		<link>http://www.fusioncube.net/index.php/sencha-extjs-combobox-selectedvalue-equivalent-for-datagrid</link>
		<comments>http://www.fusioncube.net/index.php/sencha-extjs-combobox-selectedvalue-equivalent-for-datagrid#comments</comments>
		<pubDate>Tue, 20 Jul 2010 15:39:30 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Sencha]]></category>
		<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[datagrid]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[renderer]]></category>
		<category><![CDATA[selectedValue]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/index.php/sencha-extjs-combobox-selectedvalue-equivalent-for-datagrid</guid>
		<description><![CDATA[Man this took a long time to figure out. Ok, inside a Sencha ExtJS DataGrid, I have assigned a ComboBox as the editor for one of the columns populated with its own Store of items. I’ve got a ColdFusion Component returning a query object, which is then converted into JSON with the ajaxCFC class. var [...]]]></description>
			<content:encoded><![CDATA[<p>Man this took a long time to figure out.</p>
<p>Ok, inside a Sencha ExtJS DataGrid, I have assigned a ComboBox as the editor for one of the columns populated with its own Store of items. I’ve got a ColdFusion Component returning a query object, which is then converted into JSON with the <a href="http://www.fusioncube.net/index.php/invoking-coldspring-bean-with-ajaxcfc" target="_blank">ajaxCFC</a> class.</p>
<pre class="code"><code>var ItemCode = Ext.data.Record.create([
       {name: 'item_id', type: 'int'}
       {name: 'item_code', type: 'string'}
]);

var ItemCodesStore = new Ext.data.Store({
    autoLoad:false,
    proxy: new Ext.data.MemoryProxy(),
    reader: new Ext.data.JsonReader({ root: 'data'; }, ItemCode)
});

// Snippet from ColumnModel of DataGrid
header: 'Code',
dataIndex: 'existingCode',
width: 70,
editor: new Ext.form.ComboBox({
   mode: 'local',
   displayField: 'item_code',
   valueField: 'item_id',
   store: ItemCodesStore
})
</code></pre>
<p>This is straightforward code. The column represents the <em>existingCode</em> value in the DataGrid&#8217;s store, and when the user clicks on an individual cell, a ComboBox is rendered with possible values stored in ItemCodesStore. </p>
<p>My problem is that I want the <em>item_code</em> value displayed at all times. By default, when a user selects an item from the ComboBox, the <em>item_id</em> value will be displayed, because even though I have set <em>displayField:&#8217;item_code&#8217;</em> in the ComboBox, the DataGrid has no knowledge of this, and always shows the valueField.</p>
<p>What I had to do was write a custom renderer for that column that does a search in the ItemCodes store for a matching <em>item_id</em> and return the <em>item_code</em> to be rendered instead.</p>
<pre class="code"><code>function CodeRenderer(val){
    var matching = ItemCodesStore.queryBy(
                      function(rec,id){
                         return rec.item_id == val;
                      });
    return (matching.items[0]) ? matching.items[0].data.item_code : '';
};

// Snippet from ColumnModel of DataGrid
header: 'Code',
dataIndex: 'existingCode',
width: 70,
<strong>renderer: CodeRenderer,</strong>
editor: new Ext.form.ComboBox({
   mode: 'local',
   displayField: 'item_code',
   valueField: 'item_id',
   store: ItemCodesStore
})</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/sencha-extjs-combobox-selectedvalue-equivalent-for-datagrid/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
