setValue is called whenever you mouse over
the item as well because it will give you the opportunity to change the
renderer’s appearance based on the selection/highlight state. So if
setting the value is an expensive operation for your renderer it is a good idea
to check whether the value has actually changed before doing any manipulation.
Matt
In my experience, setValue() is called even if you just move the mouse
over the cell...am I missing something ?
--- In [email protected],
Manish Jethani
<[EMAIL PROTECTED]> wrote:
> On 6/27/05, sanjayd <[EMAIL PROTECTED]> wrote:
>
> > I wanted to color a cell in a grid, if
the value (in the cell) meets
> > certain conditions (for example, if the
value is negative). So, I
> > added couple of lines of code in the
setValue() method of the
> > cellRenderer. This works. However, the
problem is that, the setValue()
> > method gets called very frequently..
>
> setValue() is called every time you scroll
because the DataGrid reuses
> the rows and just updates them with new data
every time. If rowCount
> is 7 (default) and you have 100 rows, the
DataGrid always maintains
> just 7 row objects and keeps reusing them
(nice, no?).
>
> That's your only option, AFAIK.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
---- LSpots keywords ?>---- HM ADS ?>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
---- LSpots keywords ?>
---- HM ADS ?>
YAHOO! GROUPS LINKS