<?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; ext</title>
	<atom:link href="http://t.wits.sg/tag/ext/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>EXTJS themed file input field</title>
		<link>http://t.wits.sg/2008/09/01/extjs-themed-file-input-field/</link>
		<comments>http://t.wits.sg/2008/09/01/extjs-themed-file-input-field/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 16:38:14 +0000</pubDate>
		<dc:creator>gaweee</dc:creator>
				<category><![CDATA[entrepreneurship]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://t.wits.sg/?p=18</guid>
		<description><![CDATA[Theming a file input field has always been notoriously hard. Thanks to the guys who wrote the Ext UploadDialog script, theres now a better and more aesthetically pleasing way to create a file upload. I tried using their script wholesale but ran into some problems with the layout. So i kinda hacked and extracted their [...]]]></description>
			<content:encoded><![CDATA[<p>Theming a file input field has always been notoriously hard. Thanks to the <a href="http://www.max-bazhenov.com/dev/upload-dialog-2.0/index.php" target="_blank">guys who wrote the Ext UploadDialog script</a>, theres now a better and more aesthetically pleasing way to create a file upload. I tried using their script wholesale but ran into some problems with the layout. So i kinda hacked and extracted their Ext.ux.BrowseButton code.</p>
<p>So now you can use it simply with:</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">	new Ext.ux.BrowseButton({
		input_name: &quot;uploadfile1&quot;,
		text: &quot;Select a file&quot;
		onInputFileChange: function() {
			alert(&quot;you chose &quot; + this.getInputFile().dom.value);
		}
	})
&nbsp;
	new Ext.ux.TBBrowseButton({
		input_name: &quot;uploadfile2&quot;,
		text: &quot;Select another file&quot;
	})</pre></div></div>

<p>The first chunk of code creates a Browse Button (File Input) control as with the name uploadfile1. and the second chunk of codes creates a <strong>ToolBar</strong> Browse Button with the name uploadfile2.</p>
<p>Hypothetically you should be able to add a ToolBar button but i havent quite gotten a ToolBar Browse Button to fit aesthetically well inside a form. Let me know if you all come up with any examples that do!</p>
<p>Meanwhile, 3 cheers for the <a href="http://www.max-bazhenov.com/dev/upload-dialog-2.0/index.php" target="_blank">guys who wrote the Ext UploadDialog script</a>!!!</p>
<p><strong>Download the jQuery progressbar here: <a href="http://t.wits.sg/downloads/ ext.browsebutton.1.0.zip" target="_blank">EXT Browse Button</a><br />
or view the demo <a href="http://t.wits.sg/misc/EXTBrowseButton/demo.php" target="_blank">here</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://t.wits.sg/2008/09/01/extjs-themed-file-input-field/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>

