<?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>Marcus Schiesser</title>
	<atom:link href="http://www.marcusschiesser.de/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.marcusschiesser.de</link>
	<description>Discovering User Interface Technologies</description>
	<lastBuildDate>Mon, 02 Nov 2009 20:56:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to detect whether an element is in a scrollable parent</title>
		<link>http://www.marcusschiesser.de/?p=352</link>
		<comments>http://www.marcusschiesser.de/?p=352#comments</comments>
		<pubDate>Mon, 02 Nov 2009 20:54:28 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[hidden]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[overflow]]></category>
		<category><![CDATA[parent]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[scrollable]]></category>
		<category><![CDATA[visible]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=352</guid>
		<description><![CDATA[Just think of having an element in a scrollable parent (the CSS property overflow is set to scroll) and you want to test whether the element is visible or not.
Using this little function you can do the trick:

function isInView&#40;node&#41;&#123;
            var offsetParent = node.offsetParent;
  [...]]]></description>
			<content:encoded><![CDATA[<p>Just think of having an element in a scrollable parent (the CSS property <code>overflow</code> is set to <code>scroll</code>) and you want to test whether the element is visible or not.</p>
<p>Using this little function you can do the trick:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> isInView<span style="color: #009900;">&#40;</span>node<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> offsetParent <span style="color: #339933;">=</span> node.<span style="color: #660066;">offsetParent</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> top <span style="color: #339933;">=</span> offsetParent.<span style="color: #660066;">scrollTop</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> height <span style="color: #339933;">=</span> offsetParent.<span style="color: #660066;">offsetHeight</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> y <span style="color: #339933;">=</span> node.<span style="color: #660066;">offsetTop</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">return</span> y <span style="color: #339933;">&gt;=</span> top <span style="color: #339933;">&amp;&amp;</span> y <span style="color: #339933;">&lt;=</span> <span style="color: #009900;">&#40;</span>top <span style="color: #339933;">+</span> height<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And here&#8217;s a small use case &#8211; this one scrolls the element into the visible region, if it is not already in the view:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>isInView<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            element.<span style="color: #660066;">scrollIntoView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=352</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let the user select an item in a modal dialog</title>
		<link>http://www.marcusschiesser.de/?p=328</link>
		<comments>http://www.marcusschiesser.de/?p=328#comments</comments>
		<pubDate>Wed, 05 Aug 2009 13:31:29 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[choose]]></category>
		<category><![CDATA[item]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[selector]]></category>
		<category><![CDATA[yui3]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=328</guid>
		<description><![CDATA[After having used the shiny new YUI3 library for a project, it&#8217;s about time to share my YUI3 experiences with you.
For the project I built an item selector: A modal dialog is openend and the user has to select an item. After selection the dialog is closed and the selected item is passed to a [...]]]></description>
			<content:encoded><![CDATA[<p>After having used the shiny new <a href="http://developer.yahoo.com/yui/3/">YUI3</a> library for a project, it&#8217;s about time to share my YUI3 experiences with you.<br />
For the project I built an item selector: A modal dialog is openend and the user has to select an item. After selection the dialog is closed and the selected item is passed to a callback function.</p>
<p>Here you can find the <a href="http://www.marcusschiesser.de/wp-content/uploads/2009/08/ItemSelector.js">full source</a> for the item selector. An example to use the selector can be as simple as this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">ms.<span style="color: #660066;">ItemSelector</span>.<span style="color: #660066;">selectItem</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Bart'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Lisa'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Homer'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Marge'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Maggie'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Ned'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Barney'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Bob'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">' is your favorite character.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Just click on the following button, to start the example. Enjoy and let me know your comments.</p>
<style type="text/css">			a.item-selector-clickme {
				background-color: red;
				padding: 4px;
				color: white;
				text-decoration: none;
			}	a.item-selector-clickme:hover {
				color: yellow;
			}  .item-selector-header {
                font-weight: bold;
                padding: 10px;
            } .item-selector {
                overflow: auto;
                height: 150px;
            }.item-selector li a:hover {
                color: red;
            }.item-selector li {
                list-style: none;
            } .item-selector li a {
                text-decoration: none;
                color: #333;
            }  .yui-overlay-content {
                padding: 3px; font-size: 16px;  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
				width: 200px;
				height: 210px;
                border: 2px solid #000;
                background-color: #fff;
            }
        </style>
<p>        <script type="text/javascript" src="http://www.marcusschiesser.de/wp-content/uploads/2009/08/ItemSelector.js">
        </script><br />
        <script type="text/javascript" src="http://www.marcusschiesser.de/wp-content/uploads/2009/08/itemselector.js">
        </script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=328</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quince: UX Pattern Explorer</title>
		<link>http://www.marcusschiesser.de/?p=319</link>
		<comments>http://www.marcusschiesser.de/?p=319#comments</comments>
		<pubDate>Sat, 13 Jun 2009 20:14:17 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[UX]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[explorer]]></category>
		<category><![CDATA[pattern]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=319</guid>
		<description><![CDATA[Just in case you don&#8217;t already know it: Quince &#8211; calls itself an UX Patterns Explorer and that&#8217;s just what it is.
You want to improve the user experience of your applications? Just take a look at this marble. It contains a large number of design patterns for creating great user interfaces.
Even the exploration part of [...]]]></description>
			<content:encoded><![CDATA[<p>Just in case you don&#8217;t already know it: <a href="http://quince.infragistics.com/">Quince</a> &#8211; calls itself an UX Patterns Explorer and that&#8217;s just what it is.</p>
<p>You want to improve the user experience of your applications? Just take a look at this marble. It contains a large number of <a href="http://en.wikipedia.org/wiki/Design_patterns">design patterns</a> for creating great user interfaces.</p>
<p>Even the exploration part of this tool is innovative: The patterns are not only ordered alphabetically by name but can be found by the tasks the user wants to accomplish.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=319</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a delete button in each row of an ExtJS data grid</title>
		<link>http://www.marcusschiesser.de/?p=309</link>
		<comments>http://www.marcusschiesser.de/?p=309#comments</comments>
		<pubDate>Sat, 13 Jun 2009 19:53:56 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[data grid]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[row]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=309</guid>
		<description><![CDATA[For usability reasons it is usually a good idea to add a delete button to each row of a data grid. If the user clicks on such a button, the whole row that contained the button will be deleted.
The following example shows what I mean:

.extensive-remove {
background-image: url(http://www.marcusschiesser.de/wp-content/uploads/2009/06/remove.gif) ! important;
}

 
The data grid of ExtJS does [...]]]></description>
			<content:encoded><![CDATA[<p>For usability reasons it is usually a good idea to add a delete button to each row of a data grid. If the user clicks on such a button, the whole row that contained the button will be deleted.<br />
The following example shows what I mean:</p>
<style>
.extensive-remove {
background-image: url(http://www.marcusschiesser.de/wp-content/uploads/2009/06/remove.gif) ! important;
}
</style>
<p><script src="http://www.marcusschiesser.de/wp-content/uploads/2009/06/ItemDeleter.js"></script> <script src="http://www.marcusschiesser.de/wp-content/uploads/2009/06/item-deleter.js"></script></p>
<p>The data grid of <a href="http://www.extjs.com">ExtJS</a> does not contain such a feature by default, but it could be implemented by adding a special column to the column model. Using <a href="http://www.marcusschiesser.de/wp-content/uploads/2009/06/ItemDeleter.js">this extension</a>, it could be easily done like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> itemDeleter <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Extensive.<span style="color: #660066;">grid</span>.<span style="color: #660066;">ItemDeleter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> grid <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        store<span style="color: #339933;">:</span> people<span style="color: #339933;">,</span>
        cm<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">ColumnModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">RowNumberer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
            header<span style="color: #339933;">:</span> <span style="color: #3366CC;">'First name'</span><span style="color: #339933;">,</span>
            width<span style="color: #339933;">:</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>
            dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'firstName'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
            header<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Last name'</span><span style="color: #339933;">,</span>
            width<span style="color: #339933;">:</span> <span style="color: #CC0000;">150</span><span style="color: #339933;">,</span>
            dataIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">'lastName'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> itemDeleter<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        selModel<span style="color: #339933;">:</span> itemDeleter<span style="color: #339933;">,</span>
        autoHeight<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Note that the <code>itemDeleter</code> instance must be added to the <code>ColumnModel</code> and set as <code>selModel</code> to work properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=309</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Learn how to build a web application with ExtJS</title>
		<link>http://www.marcusschiesser.de/?p=297</link>
		<comments>http://www.marcusschiesser.de/?p=297#comments</comments>
		<pubDate>Sat, 13 Jun 2009 18:28:09 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[european]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[german]]></category>
		<category><![CDATA[government]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[meinkabinett]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[vote]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=297</guid>
		<description><![CDATA[
If you&#8217;re interested in learning ExtJS and by accident know some German, I can recommend you read an article I wrote together with my colleague Stefan Botzenhart. The article is called &#8216;Kombiniert: Ruby on Rails und Ext JS&#8216; and is published in the famous German IT magazine iX in their actual special edition called Web [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="iX special 02/2009 - Web on Rails " src="http://www.heise.de/ix/images/titel/special0109.gif" alt="" width="130" height="184" /></p>
<p>If you&#8217;re interested in learning <a href="http://www.extjs.com">ExtJS</a> and by accident know some German, I can recommend you read an article I wrote together with my colleague <a href="http://blog.stefanbotzenhart.com/">Stefan Botzenhart</a>. The article is called &#8216;<em>Kombiniert: Ruby on Rails und Ext JS</em>&#8216; and is published in the famous <a href="http://www.heise.de/ix/">German IT magazine iX</a> in their actual special edition called <a href="http://www.heise.de/kiosk/special/ix/09/01/">Web on Rails</a>.</p>
<p>In the article we explain the implementation of <a href="http://www.meinkabinett.de/">meinkabinett</a>, a web application where people can vote celebrities for the European government. The implementation uses a rich front-end written in ExtJS and is driven by a Ruby on Rails back-end.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=297</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display an info text in a HTML input field if its focus is lost</title>
		<link>http://www.marcusschiesser.de/?p=286</link>
		<comments>http://www.marcusschiesser.de/?p=286#comments</comments>
		<pubDate>Fri, 12 Jun 2009 09:18:02 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[core]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[field]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[info]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[lost]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=286</guid>
		<description><![CDATA[
        		.extensive-info-text {
        			color: gray;
					font-style: italic;
        		}

Now that with Ext Core a light-weight version (just 25kB) of ExtJS has been released, I thought it&#8217;s time to build a nice example with it.
The result is [...]]]></description>
			<content:encoded><![CDATA[<style>
        		.extensive-info-text {
        			color: gray;
					font-style: italic;
        		}
</style>
<p>Now that with <a href="http://extjs.com/products/extcore">Ext Core</a> a light-weight version (just 25kB) of ExtJS has been released, I thought it&#8217;s time to build a nice example with it.</p>
<p>The result is something very useful that you can see in actually a lot of web sites: Display a info text inside of a input text field if it is empty and does not have the focus. </p>
<p>Here&#8217;s how it looks like:<br />
<script src='http://www.marcusschiesser.de/wp-content/uploads/2009/06/SetInfoText.js'></script></p>
<p>E-Mail: <script src='http://www.marcusschiesser.de/wp-content/uploads/2009/06/set-info-text.js'></script></p>
<p>To add this behaviour to a input field you just have to call this single line:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Extensive.<span style="color: #660066;">behaviours</span>.<span style="color: #660066;">setInfoText</span><span style="color: #009900;">&#40;</span>inputElement<span style="color: #339933;">,</span> <span style="color: #3366CC;">'Your email like max@mustermann.de'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As always you can find the code for this component in a library called &#8216;<a href="http://code.google.com/p/extensive/">extensive</a>&#8216;. Feel free to support the project by participating.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=286</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mark Required Fields in a ExtJS Form</title>
		<link>http://www.marcusschiesser.de/?p=259</link>
		<comments>http://www.marcusschiesser.de/?p=259#comments</comments>
		<pubDate>Mon, 04 May 2009 12:12:48 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[field]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[required]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=259</guid>
		<description><![CDATA[I just had the requirement to mark required fields in a ExtJS form. I started with the code from Jason (Thanks!) and extended it a bit.
Now you may customize how the field marker would look like by assigning a CSS class to a requiredFieldCls property. I also added a descriptive tooltip for the marker &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>I just had the requirement to mark required fields in a ExtJS form. I started with the <a href="http://blog.edseek.com/archives/2009/04/19/illuminate-required-fields-via-extjs/">code from Jason</a> (Thanks!) and extended it a bit.<br />
Now you may customize how the field marker would look like by assigning a CSS class to a <code>requiredFieldCls</code> property. I also added a descriptive tooltip for the marker &#8211; just take a look to the example below:<br />
<script type="text/javascript" src="http://www.marcusschiesser.de/wp-content/uploads/2009/05/requiredfieldmarker.js"></script><br />
<script type="text/javascript" src="http://www.marcusschiesser.de/wp-content/uploads/2009/05/required-field.js"></script></p>
<p>Here&#8217;s the code that produces the example:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">onReady</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    Ext.<span style="color: #660066;">QuickTips</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">Field</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">msgTarget</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'under'</span><span style="color: #339933;">;</span>
    Extensive.<span style="color: #660066;">components</span>.<span style="color: #660066;">RequiredFieldInfo</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">requiredFieldText</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'These are really important things'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> panel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">FormPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        frame<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        labelWidth<span style="color: #339933;">:</span> <span style="color: #CC0000;">130</span><span style="color: #339933;">,</span>
        width<span style="color: #339933;">:</span> <span style="color: #CC0000;">350</span><span style="color: #339933;">,</span>
&nbsp;
        items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>
            xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'textfield'</span><span style="color: #339933;">,</span>
            fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'This you might tell me'</span><span style="color: #339933;">,</span>
            anchor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
            xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'textfield'</span><span style="color: #339933;">,</span>
            fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'This I have to know'</span><span style="color: #339933;">,</span>
            allowBlank<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
            anchor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span><span style="color: #339933;">,</span>
            blankText<span style="color: #339933;">:</span> <span style="color: #3366CC;">'As said, I have to know this!'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
            xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'reqFieldInfo'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> element <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script[src$=required-field.js]'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> renderElement <span style="color: #339933;">=</span> element.<span style="color: #660066;">parentNode</span><span style="color: #339933;">;</span>
    panel.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</span>renderElement<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Dont&#8217; forget to also include these necessary modifications to <code>Ext.layout.FormLayout</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">ns</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Extensive.components'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Ext.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">layout</span>.<span style="color: #660066;">FormLayout</span>.<span style="color: #660066;">prototype</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
    originalRenderItem<span style="color: #339933;">:</span> Ext.<span style="color: #660066;">layout</span>.<span style="color: #660066;">FormLayout</span>.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">renderItem</span><span style="color: #339933;">,</span>
    renderItem<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>c<span style="color: #339933;">,</span> position<span style="color: #339933;">,</span> target<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>c <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>c.<span style="color: #660066;">rendered</span> <span style="color: #339933;">&amp;&amp;</span> c.<span style="color: #660066;">isFormField</span> <span style="color: #339933;">&amp;&amp;</span> c.<span style="color: #660066;">fieldLabel</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>c.<span style="color: #660066;">allowBlank</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            c.<span style="color: #660066;">fieldLabel</span> <span style="color: #339933;">=</span> c.<span style="color: #660066;">fieldLabel</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; &lt;span &quot;</span> <span style="color: #339933;">+</span>
            <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>c.<span style="color: #660066;">requiredFieldCls</span> <span style="color: #339933;">!==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">'class=&quot;'</span> <span style="color: #339933;">+</span> c.<span style="color: #660066;">requiredFieldCls</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;'</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'style=&quot;color:red;&quot;'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span>
            <span style="color: #3366CC;">&quot; ext:qtip=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #339933;">+</span>
            <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>c.<span style="color: #660066;">blankText</span> <span style="color: #339933;">!==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> c.<span style="color: #660066;">blankText</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;This field is required&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span>
            <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;*&lt;/span&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">originalRenderItem</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Extensive.<span style="color: #660066;">components</span>.<span style="color: #660066;">RequiredFieldInfo</span> <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">Label</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
    constructor<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        Extensive.<span style="color: #660066;">components</span>.<span style="color: #660066;">RequiredFieldInfo</span>.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">constructor</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> Ext.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
            html<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&lt;span &quot;</span> <span style="color: #339933;">+</span>
            <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">requiredFieldCls</span> <span style="color: #339933;">!==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">'class=&quot;'</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">requiredFieldCls</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;'</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'style=&quot;color:red;&quot;'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span>
            <span style="color: #3366CC;">'&gt;*&lt;/span&gt; '</span> <span style="color: #339933;">+</span>
            <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">requiredFieldText</span> <span style="color: #339933;">!==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">requiredFieldText</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'Required field'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> config<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Ext.<span style="color: #660066;">reg</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'reqFieldInfo'</span><span style="color: #339933;">,</span> Extensive.<span style="color: #660066;">components</span>.<span style="color: #660066;">RequiredFieldInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>From know on you can find this code and all my other ExTJS components bundled in <a href="http://code.google.com/p/extensive/">a library called &#8216;extensive&#8217;</a> &#8211; hosted at Google Code. Feel free to support the project by participating.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=259</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Phone number selector in ExtJS</title>
		<link>http://www.marcusschiesser.de/?p=232</link>
		<comments>http://www.marcusschiesser.de/?p=232#comments</comments>
		<pubDate>Wed, 08 Apr 2009 17:10:42 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[country]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[field]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[selector]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=232</guid>
		<description><![CDATA[Wouldn&#8217;t it be nice to use a combo box of flag images to select the country code of phone numbers? 
If you use a country selection component that&#8217;s quite easy. Just wrap it in a re-usable component together with a textfield for the local number and the result looks like this:
iconcombo1countrycombo1phonefieldphonefield1
And here&#8217;s the example&#8217;s source:

Ext.onReady&#40;function&#40;&#41;&#123;
 [...]]]></description>
			<content:encoded><![CDATA[<p>Wouldn&#8217;t it be nice to use a combo box of flag images to select the country code of phone numbers? </p>
<p>If you use a <a href="http://www.marcusschiesser.de/?p=209">country selection component</a> that&#8217;s quite easy. Just wrap it in a re-usable component together with a textfield for the local number and the result looks like this:</p>
<p><script type="text/javascript" src='http://www.marcusschiesser.de/wp-content/uploads/2009/04/iconcombo1.js'>iconcombo1</script><script type="text/javascript" src='http://www.marcusschiesser.de/wp-content/uploads/2009/04/countrycombo1.js'>countrycombo1</script><script type="text/javascript" src='http://www.marcusschiesser.de/wp-content/uploads/2009/04/phonefield.js'>phonefield</script><script type="text/javascript" src='http://www.marcusschiesser.de/wp-content/uploads/2009/04/phonefield1.js'>phonefield1</script></p>
<p>And here&#8217;s the example&#8217;s source:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">onReady</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> panel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">FormPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        style<span style="color: #339933;">:</span> <span style="color: #3366CC;">'padding: 10px;'</span><span style="color: #339933;">,</span>
        frame<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        labelWidth<span style="color: #339933;">:</span> <span style="color: #CC0000;">50</span><span style="color: #339933;">,</span>
        width<span style="color: #339933;">:</span> <span style="color: #CC0000;">400</span><span style="color: #339933;">,</span>
&nbsp;
        items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>
            fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Mobile'</span><span style="color: #339933;">,</span>
            xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'phonefield'</span><span style="color: #339933;">,</span>
            anchor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span><span style="color: #339933;">,</span>
            emptyText<span style="color: #339933;">:</span> <span style="color: #3366CC;">'(e.g.: 423-423-423)'</span><span style="color: #339933;">,</span>
            defaultCountryCode<span style="color: #339933;">:</span> <span style="color: #3366CC;">'49'</span><span style="color: #339933;">,</span>
            maskRe<span style="color: #339933;">:</span> <span style="color: #009966; font-style: italic;">/[0-9 -]/</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> element <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script[src$=phonefield.js]'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> renderElement <span style="color: #339933;">=</span> element.<span style="color: #660066;">parentNode</span><span style="color: #339933;">;</span>
    panel.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</span>renderElement<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><b>Update:</b> You can find this code and all my other ExtJS components bundled in <a href="http://code.google.com/p/extensive/">a library called &#8216;extensive&#8217;</a>. Enjoy the code and feel free to support the project by participating.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=232</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Component for selecting multiple items in Ext</title>
		<link>http://www.marcusschiesser.de/?p=224</link>
		<comments>http://www.marcusschiesser.de/?p=224#comments</comments>
		<pubDate>Wed, 08 Apr 2009 16:52:08 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[combo]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[items]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[selector]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=224</guid>
		<description><![CDATA[Ext already provides a component to select multiple items. The thing I do not like about it is that it covers too much space on the screen.
Therefore I thought of a component that initially looks like a combo box and then opens a new window to let the user select the items.
As a nice example [...]]]></description>
			<content:encoded><![CDATA[<p>Ext already provides <a href="http://extjs.com/deploy/dev/examples/multiselect/multiselect-demo.html">a component to select multiple items</a>. The thing I do not like about it is that it covers too much space on the screen.<br />
Therefore I thought of a component that initially looks like a combo box and then opens a new window to let the user select the items.</p>
<p>As a nice example tells more than thousand words &#8211; here it is:</p>
<p><script type="text/javascript" src="http://www.marcusschiesser.de/wp-content/uploads/2009/04/ddview.js">
</script><script type="text/javascript" src="http://www.marcusschiesser.de/wp-content/uploads/2009/04/multiselect.js"></script><script type="text/javascript" src="http://www.marcusschiesser.de/wp-content/uploads/2009/04/itemselector.js"></script><script type="text/javascript" src="http://www.marcusschiesser.de/wp-content/uploads/2009/04/multiselect1.js"></script><script type="text/javascript" src="http://www.marcusschiesser.de/wp-content/uploads/2009/04/ext-multiselector.js"></script></p>
<p>As you can see, it is actually based on the component provided by the Ext examples. </p>
<p>And here&#8217;s the source code for the example:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">onReady</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> model <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">data</span>.<span style="color: #660066;">SimpleStore</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        fields<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'label'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        data<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Homer'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Marge'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Maggie'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Bart'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Lisa'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> panel <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">FormPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        frame<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
        labelWidth<span style="color: #339933;">:</span> <span style="color: #CC0000;">50</span><span style="color: #339933;">,</span>
        width<span style="color: #339933;">:</span> <span style="color: #CC0000;">300</span><span style="color: #339933;">,</span>
&nbsp;
        items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>
            fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">'I like'</span><span style="color: #339933;">,</span>
            xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'singleLineMultiSelect'</span><span style="color: #339933;">,</span>
            store<span style="color: #339933;">:</span> model<span style="color: #339933;">,</span>
            anchor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'90%'</span><span style="color: #339933;">,</span>
            mode<span style="color: #339933;">:</span> <span style="color: #3366CC;">'local'</span><span style="color: #339933;">,</span>
            displayField<span style="color: #339933;">:</span> <span style="color: #3366CC;">'label'</span><span style="color: #339933;">,</span>
            fromLegend<span style="color: #339933;">:</span> <span style="color: #3366CC;">'available'</span><span style="color: #339933;">,</span>
            toLegend<span style="color: #339933;">:</span> <span style="color: #3366CC;">'selected'</span><span style="color: #339933;">,</span>
            valueField<span style="color: #339933;">:</span> <span style="color: #3366CC;">'value'</span><span style="color: #339933;">,</span>
            deleteText<span style="color: #339933;">:</span> <span style="color: #3366CC;">'delete'</span><span style="color: #339933;">,</span>
            emptyText<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Which Simpsons do you like?'</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> element <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">query</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'script[src$=ext-multiselector.js]'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> renderElement <span style="color: #339933;">=</span> element.<span style="color: #660066;">parentNode</span><span style="color: #339933;">;</span>
    panel.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</span>renderElement<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Altough the example binds an in-memory store, you can also use an external store. If so, please remove the <code>mode</code> property &#8211; similar to a combo box.</p>
<p><b>Update:</b> You can find this code and all my other ExtJS components bundled in <a href="http://code.google.com/p/extensive/">a library called &#8216;extensive&#8217;</a>. Enjoy the code and feel free to support the project by participating.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=224</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting values from a form containing combos in Ext</title>
		<link>http://www.marcusschiesser.de/?p=219</link>
		<comments>http://www.marcusschiesser.de/?p=219#comments</comments>
		<pubDate>Tue, 07 Apr 2009 15:54:45 +0000</pubDate>
		<dc:creator>Marcus Schiesser</dc:creator>
				<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[combo]]></category>
		<category><![CDATA[ext]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[values]]></category>

		<guid isPermaLink="false">http://www.marcusschiesser.de/?p=219</guid>
		<description><![CDATA[Actually it is pretty easy to get the values of all fields of a form in Ext: You just have to call the getValues() method of the BasicForm.
The problem with that approach is that it just takes the values directly from the DOM and is not calling the getValue() for each field (Which I assumed). [...]]]></description>
			<content:encoded><![CDATA[<p>Actually it is pretty easy to get the values of all fields of a form in Ext: You just have to call the <code>getValues()</code> method of the <code>BasicForm</code>.<br />
The problem with that approach is that it just takes the values directly from the DOM and is not calling the <code>getValue()</code> for each field (Which I assumed). One consequence is that you don&#8217;t get the values of combo boxes, but their labels.<br />
To get the real values, I just did the following:</p>
<p>Firstly, I retrieved an array of all fields of the form:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> fields <span style="color: #339933;">=</span> that.<span style="color: #660066;">findBy</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>comp<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> comp.<span style="color: #660066;">xtype</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'fieldset'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>(In my case these were just all children that were no fieldsets. You might have to change the condition above to suit your needs.)</p>
<p>Then, I just iterated over all fields and added the name/value pair to a result object:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> result <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
fields.<span style="color: #660066;">forEach</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>field<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span> <span style="color: #339933;">=</span> field.<span style="color: #660066;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> value <span style="color: #339933;">=</span> field.<span style="color: #660066;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	result<span style="color: #009900;">&#91;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>That&#8217;s it &#8211; now <code>result</code> contains the real values of all fields.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusschiesser.de/?feed=rss2&amp;p=219</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
