Hi,
I've found this example (source view, see AccountBalanceItemRenderer.as) thanks to a prior post and it's working ok. I suppose there's a typo in your code, if not, maybe you should put the overridden function inside your class.

Hope it helps,
Oriol.

2006/8/18, Oriol Gual <[EMAIL PROTECTED]>:
I'm having the same problem, with a different approach but the result is the same. Any one can help?

Thanks,

Oriol.

2006/8/18, Oscar < [EMAIL PROTECTED]>:

  I have a datagrid with an itemRenderer in one of the columns. The
text in that column turns red if a condition is met. The example
below shows what I mean. However, if you scroll the datagrid or
resize the screen so that the DG needs to be redrawn, the
itemRenderer applies the setStyle to the rows that now are where the
original row was. If you keep scrolling the DG down and up, all the
rows end up with the style applied to them, wheter or not they meet
the criteris in the Itemrenderer. Is this a bug? or am I missing
something here?

---------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
layout="absolute">
        <mx:Script>
                <![CDATA[
                        [Bindable]
                        public var myArray:Array =[{a:10,b:15, c: 21},
{a:5,b:1,c: 4},{a:10,b:15, c: 21},
                        {a:10,b:15, c: 2},{a:10,b:15, c: 2},
{a:10,b:15, c: 2},
                        {a:10,b:15, c: 2},{a:10,b:15, c: 2},
{a:10,b:15, c: 2},
                        {a:10,b:15, c: 2},{a:10,b:15, c: 2},
{a:10,b:15, c: 2},
                        {a:10,b:15, c: 2},{a:10,b:15, c: 2},
{a:10,b:15, c: 2}
                        ];

                ]]>
        </mx:Script>

          <mx:DataGrid dataProvider="{myArray}">
                <mx:columns>
                        <mx:DataGridColumn headerText="A"
dataField="a"/>
                        <mx:DataGridColumn headerText="B"
dataField="b"/>
                        <mx:DataGridColumn headerText="C"
dataField="c" itemRenderer="myRenderer"/>

                </mx:columns>
          </mx:DataGrid>
</mx:Application>


---------------

<--myRenderer.as-- >

// ActionScript file
package {
        import mx.controls.Text;

        public class myRenderer extends Text
        {
                 public function myRenderer() {

        }
        override public function set data(value:Object):void {
            super.data = "">
           if (Number(this.text) >  Number(value.a)*2)
                   this.setStyle("color","red");

            super.invalidateDisplayList();

        }
        }
}






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/






__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to