Hi All,

  I am trying to use a Slider as an Item Renderer & Editor in an ADG. Here is 
the sample code i have and it doesn't display the values that are passed to tge 
grid and also the value changes i made using the slider are not getting stored 
in the selected Item..

[CODE]

<mx:AdvancedDataGridColumn dataField="sliderVal" headerText="Slider Test" 
editable="true"
                                                editorDataField="updatedValue"
                                                        rendererIsEditor="true" 
itemRenderer="mytest.SliderItemEditor">                                         
</mx:AdvancedDataGridColumn>

[/CODE]

And the Item Editor have is:

[CODE]
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"; width="100%" height="100%" 
verticalAlign="top" horizontalAlign="center">

        <mx:Script>
        <![CDATA[
        public var updatedValue:Number;
        private var log:ILogger=LogUtils.getLogger(this);

        override public function set data(value:Object):void
        {
                if(value!=null)
                {
                slider.value=parseInt(String(value));
                }
        }
        public function valueChanged():void
        {
                updatedValue = slider.value;
        }

        ]]>
    </mx:Script>
    <mx:HSlider id="slider" minimum="0" maximum="1" value="{data.value}" 
labels="['0','1']" change="valueChanged()"
        updateComplete="updatedValue=slider.value;"/>
</mx:HBox>
[/CODE]

And i am passing an ArrayCollection of type "Node" s to the ADG

[CODE]
 
  class Node{

     public var sliderVal:Number;

     // Other members..
  }

[/CODE]

Thanks
mars

Reply via email to