<?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>Tips for Twits&#187; bugfix</title>
	<atom:link href="http://t.wits.sg/tag/bugfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://t.wits.sg</link>
	<description>WARNING: excessive use of this site will increase MP at the expense of HP</description>
	<lastBuildDate>Tue, 12 Jul 2011 15:09:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>HOWTO: Fix EXTJS Textarea for IE6</title>
		<link>http://t.wits.sg/2008/06/17/howto-fix-extjs-textarea-for-ie6/</link>
		<comments>http://t.wits.sg/2008/06/17/howto-fix-extjs-textarea-for-ie6/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 06:34:23 +0000</pubDate>
		<dc:creator>gaweee</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[bugfix]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://t.wits.sg/?p=8</guid>
		<description><![CDATA[I encountered a interesting display bug when working with EXTJS recently. The following code renders well in FF 2 and above but not in IE6. var form = new Ext.form.FormPanel({ baseCls: 'x-plain', labelWidth: 140, url: 'abc/def.php', defaultType: 'textfield', items: [{ fieldLabel: 'Name', name: 'name', anchor:'100%' // anchor width by percentage }, { xtype: 'textarea', fieldLabel: [...]]]></description>
			<content:encoded><![CDATA[<p>I encountered a interesting display bug when working with EXTJS recently. The following code renders well in FF 2 and above but not in IE6.</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">var form = new Ext.form.FormPanel({
	baseCls: 'x-plain',
	labelWidth: 140,
	url: 'abc/def.php',
	defaultType: 'textfield',
	items: [{
		fieldLabel: 'Name',
		name: 'name',
		anchor:'100%'  // anchor width by percentage
	}, {
		xtype: 'textarea',
		fieldLabel: 'Description',
		name: 'description',
		anchor: '100% -30'  // bug in IE6
	}]
});
&nbsp;
var window = new Ext.Window({
	title: 'Some Window',
	width: 500, height: 300, 
	layout: 'fit',
	plain: true,
	buttonAlign: 'center',
	items: form
});
&nbsp;
window.show();</pre></div></div>

<p> brian.moeskau  from the EXTJS forums was kind enough to answer this problem. The fix is a piece of code that primes the width of the controls to prevent it from overflowing out of the window/panels. The code is as follows</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">Ext.override(Ext.form.Field, {
    adjustWidth : function(tag, w){
        tag = tag.toLowerCase();
        if(typeof w == 'number' &amp;&amp; !Ext.isSafari){
            if(Ext.isIE &amp;&amp; (tag == 'input' || tag == 'textarea')){
                if(!Ext.isStrict){
                    return this.inEditor ? w : w - 3;
                }
                if(tag == 'input' &amp;&amp; Ext.isStrict){
                    return w - (Ext.isIE6 ? 4 : 1);
                }
                if(tag == 'textarea' &amp;&amp; Ext.isStrict){
                    return w-4;
                }
            }else if(Ext.isOpera &amp;&amp; Ext.isStrict){
                if(tag == 'input'){
                    return w + 2;
                }
                if(tag == 'textarea'){
                    return w-2;
                }
            }
        }
        return w;
    }
});</pre></div></div>

<p>I hope this will solve other people&#8217;s problems too!</p>
]]></content:encoded>
			<wfw:commentRss>http://t.wits.sg/2008/06/17/howto-fix-extjs-textarea-for-ie6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

