Thanks Oriol,

I made changes, similar to yours, to the sample.  It fixed the problem.

-TH

View Sample 

--- In [email protected], "Oriol Gual" <[EMAIL PROTECTED]> wrote:
>
> Yes, is working ok for me, I've tried sorting it on every column an
> scrolling, and there's no problem. I've only changed a few things, this is
> my itemRenderer code:
>
> package
> {
> import mx.controls.Text;
>
> public class VariacioItemRenderer extends Text
> {
> public function VariacioItemRenderer() {
>
> }
> override public function set data(value:Object):void {
> super.data = "">> if(value!=null) {
> if (value.variacio < 0)
> {
> this.setStyle("color","red");
> }
> else
> {
> this.setStyle("color","green");
> }
> this.text = value.variacio + "%";
> }
> super.invalidateDisplayList();
> }
> }
> }
>
> 2006/8/18, Oscar [EMAIL PROTECTED]:
> >
> >
> > As I said, it also happens if you scroll. My original app is
> > actually calling an HTTP Service, and I am having the same problem.
> >
> > --- In [email protected], "Tim Hoff" TimHoff@ wrote:
> > >
> > > I was wondering how long it would take for someone to notice the
> > > querky sort behaviour. The example also acts strange when the
> > > StartDate column is sorted. However, when data comes from a
> > > backend, instead of hardcoded in the app, these types of problems
> > > don't seem to occur.
> > >
> > > -TH
> > >
> > > --- In [email protected], "Oscar" <oscar_cortes@> wrote:
> > > >
> > > > Are you sure that is working OK? I had seen the example
> > before,
> > > > try sorting by the last column. I has the same problem ...
> > > >
> > > > --- In [email protected], "Oriol Gual" <oriol.gual@>
> > > > wrote:
> > > > >
> > > > > Hi,
> > > > > I've found this
> > > > >
> > > >
> > >
> > example<http://www.iepl.net/DataGridItemRendererSample/DataGridItemRe
> > > n
> > > > dererSample.html>(source
> > > > > view <http://www.iepl.net/DataGridItemRendererSample/srcview/>,
> > > 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 <oriol.gual@>:
> > > > > >
> > > > > > 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 < ocortess@>:
> > > > > >
> > > > > > >
> > > > > > > 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
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> >
> >
> >
> >
> > --
> > 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
> >
> >
> >
> >
> >
> >
> >
>

__._,_.___

--
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