<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: ExtJS ComboBox Replacement</title>
	<atom:link href="http://www.jasonclawson.com/2008/05/27/extjs-combobox-replacement/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jasonclawson.com/2008/05/27/extjs-combobox-replacement/</link>
	<description>Advanced Web Development Blog</description>
	<pubDate>Wed, 08 Sep 2010 03:02:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Jason</title>
		<link>http://www.jasonclawson.com/2008/05/27/extjs-combobox-replacement/#comment-13</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 11 Jun 2008 13:34:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.jasonclawson.com/?p=24#comment-13</guid>
		<description>&lt;p&gt;I was suggesting using the method getAttribute to figure it out.  This is cross platform and works the same.  so for instance...&lt;/p&gt;
&lt;pre lang="javascript"&gt;var comboEl = Ext.get(combo); //pretend this points to the combo&lt;br /&gt;
var selectedOption = comboEl.first("[selected=true]");&lt;/pre&gt;
&lt;p&gt;I think that will work.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>I was suggesting using the method getAttribute to figure it out.  This is cross platform and works the same.  so for instance&#8230;</p>

<div class="wp_codebox_msgheader"><span class="codebox_right"><a href="javascript:;" onclick="toggle_collapse('241');">[<span id="241_symbol">-</span>]</a></span><span class="codebox_left"><span id="l24code1"><a href="javascript:;" onclick="javascript:showCodeTxt('24code1'); return false;">View Code</a> JAVASCRIPT</span></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="241"><td class="code" id="24code1"><pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> comboEl = Ext.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span>combo<span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">//pretend this points to the combo&lt;br /&gt;</span>
<span style="color: #003366; font-weight: bold;">var</span> selectedOption = comboEl.<span style="color: #006600;">first</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;[selected=true]&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>I think that will work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://www.jasonclawson.com/2008/05/27/extjs-combobox-replacement/#comment-12</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Wed, 11 Jun 2008 13:23:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.jasonclawson.com/?p=24#comment-12</guid>
		<description>IE 6 returns "true" for the selected attribute for the first item if the selected attribute wasn't set on any of the options...</description>
		<content:encoded><![CDATA[<p>IE 6 returns &#8220;true&#8221; for the selected attribute for the first item if the selected attribute wasn&#8217;t set on any of the options&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.jasonclawson.com/2008/05/27/extjs-combobox-replacement/#comment-11</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 09 Jun 2008 14:42:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.jasonclawson.com/?p=24#comment-11</guid>
		<description>&lt;p&gt;This is a really quick fix for you.  I think you might try adding a "render" listener in your combo like :&lt;/p&gt;
&lt;p&gt;render : function(combo){&lt;br /&gt;
  combo.clearValue();&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;I think the reason you are having the problem you are having is because html selects always select the first item in the list if nothing is selected.  So, Ext doesn't know that you don't want that option selected.&lt;/p&gt;
&lt;p&gt;Ideally, ExtJS should look at the DOM and check to see if the selected="true" attribute is set on one of the options.  If it isn't, then it should clear the value.&lt;/p&gt;
&lt;p&gt;If you want to write this functionality I would be glad to include it in my combo box replacement code for everyone else to use.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is a really quick fix for you.  I think you might try adding a &#8220;render&#8221; listener in your combo like :</p>
<p>render : function(combo){<br />
  combo.clearValue();<br />
}</p>
<p>I think the reason you are having the problem you are having is because html selects always select the first item in the list if nothing is selected.  So, Ext doesn&#8217;t know that you don&#8217;t want that option selected.</p>
<p>Ideally, ExtJS should look at the DOM and check to see if the selected=&#8221;true&#8221; attribute is set on one of the options.  If it isn&#8217;t, then it should clear the value.</p>
<p>If you want to write this functionality I would be glad to include it in my combo box replacement code for everyone else to use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ettiene</title>
		<link>http://www.jasonclawson.com/2008/05/27/extjs-combobox-replacement/#comment-9</link>
		<dc:creator>Ettiene</dc:creator>
		<pubDate>Mon, 09 Jun 2008 13:55:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.jasonclawson.com/?p=24#comment-9</guid>
		<description>Hi there,

I'm using the "out-of-the-box" ComboBox from extjs, and tend to agree that it's not put together very nicely.

My problem is that I'm using it to convert a normal select HTML element into a extJS ComboBox element. But I want the default text to be "Select one..", without having to create an empty select option and using their "emptyText" init var. Would you be able to help with that maybe?

Thanks</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>I&#8217;m using the &#8220;out-of-the-box&#8221; ComboBox from extjs, and tend to agree that it&#8217;s not put together very nicely.</p>
<p>My problem is that I&#8217;m using it to convert a normal select HTML element into a extJS ComboBox element. But I want the default text to be &#8220;Select one..&#8221;, without having to create an empty select option and using their &#8220;emptyText&#8221; init var. Would you be able to help with that maybe?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
