<?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>Flex Examples &#187; outerDocument</title>
	<atom:link href="http://blog.flexexamples.com/tag/outerdocument/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using a Slider control as a DataGrid column item renderer in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/09/using-a-slider-control-as-a-datagrid-column-item-renderer-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/09/using-a-slider-control-as-a-datagrid-column-item-renderer-in-flex/#comments</comments>
		<pubDate>Sat, 10 May 2008 05:49:53 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[HSlider]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[outerDocument]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/09/using-a-slider-control-as-a-datagrid-column-item-renderer-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can use an HSlider control as an item renderer in a Flex DataGrid control.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGridColumn_itemRenderer_HSlider_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/05/09/using-a-slider-control-as-a-datagrid-column-item-renderer-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ArrayCollection id="arrColl"&#62; &#60;mx:source&#62; &#60;mx:Array&#62; &#60;mx:Object label="Student A" score="85" /&#62; &#60;mx:Object label="Student B" score="48" /&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an HSlider control as an item renderer in a Flex DataGrid control.</p>
<p>Full code after the jump.</p>
<p><span id="more-623"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGridColumn_itemRenderer_HSlider_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/09/using-a-slider-control-as-a-datagrid-column-item-renderer-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ArrayCollection id="arrColl"&gt;
        &lt;mx:source&gt;
            &lt;mx:Array&gt;
                &lt;mx:Object label="Student A" score="85" /&gt;
                &lt;mx:Object label="Student B" score="48" /&gt;
                &lt;mx:Object label="Student C" score="71" /&gt;
                &lt;mx:Object label="Student D" score="88" /&gt;
                &lt;mx:Object label="Student E" score="24" /&gt;
                &lt;mx:Object label="Student F" score="64" /&gt;
                &lt;mx:Object label="Student G" score="76" /&gt;
                &lt;mx:Object label="Student H" score="76" /&gt;
                &lt;mx:Object label="Student I" score="93" /&gt;
                &lt;mx:Object label="Student J" score="88" /&gt;
                &lt;mx:Object label="Student K" score="48" /&gt;
                &lt;mx:Object label="Student L" score="76" /&gt;
            &lt;/mx:Array&gt;
        &lt;/mx:source&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:DataGrid id="dataGrid"
            dataProvider="{arrColl}"
            selectable="false"
            rowCount="6"
            width="500"&gt;
        &lt;mx:columns&gt;
            &lt;mx:DataGridColumn dataField="label" /&gt;
            &lt;mx:DataGridColumn dataField="score" /&gt;
            &lt;mx:DataGridColumn dataField="score"&gt;
                &lt;mx:itemRenderer&gt;
                    &lt;mx:Component&gt;
                        &lt;mx:HBox horizontalScrollPolicy="off"
                                verticalScrollPolicy="off"&gt;
                            &lt;mx:Script&gt;
                                &lt;![CDATA[
                                    import mx.events.SliderEvent;

                                    private function slider_change(evt:SliderEvent):void {
                                        data.score = evt.value;
                                        outerDocument.arrColl.refresh();
                                    }
                                ]]&gt;
                            &lt;/mx:Script&gt;

                            &lt;mx:HSlider minimum="0"
                                    maximum="100"
                                    value="{data.score}"
                                    liveDragging="true"
                                    snapInterval="1"
                                    width="100%"
                                    change="slider_change(event);" /&gt;
                        &lt;/mx:HBox&gt;
                    &lt;/mx:Component&gt;
                &lt;/mx:itemRenderer&gt;
            &lt;/mx:DataGridColumn&gt;
        &lt;/mx:columns&gt;
    &lt;/mx:DataGrid&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGridColumn_itemRenderer_HSlider_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/DataGridColumn_itemRenderer_HSlider_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using a Slider control as a DataGrid column item renderer in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/09/using-a-slider-control-as-a-datagrid-column-item-renderer-in-flex/',contentID: 'post-623',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'itemRenderer,outerDocument',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/05/09/using-a-slider-control-as-a-datagrid-column-item-renderer-in-flex/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

