Not sure if this was 100% the right way to accomplish what i needed, but it worked for me...

I've got a DataGrid with an itemRenderer instance that colors the background of my rows differently based on selection order... yada yada...

Anyway, came across this problem when I wanted to "clear" my selections... setting the selectedIndex = "-1" worked for actually removing the selections, but my itemRenderer instance wasn't updating the background color until it was redrawn through scrolling, etc...

So I'm using Cairngorm and figured... why not... so I set an event listener inside my renderer as follows:

CairngormEventDispatcher.getInstance().addEventListener("metricSelectionChange", setSelectionStyle);

and just dispatched that event outside when my data changed, i wanted to clear selections, whatever... voila... updated renderer...


Brendan


On 7/20/06, ben.clinkinbeard <[EMAIL PROTECTED]> wrote:

Hey Tim,

No worries, I didn't think you were being harsh, I just wanted to
clarify what I was referring to. I am very new to Flex, so as long as
it doesn't involve calling me names I am willing to listen to just
about any advice. Actually, I could probably overlook namecalling if
the info was good enough. :)

I suppose I understand the event firing due to the redraw, it just
seems like a 'dataChange' event should only fire when, you know, data
changes. I will look into your article and custom events when I get
some time, thanks for the tip.

Jesse, going to those lengths seems like a bit of overkill when all
the itemRenderer consists of is a Checkbox with a dynamic label. I
guess for now I will stick with my 'dirty and hackish' flag var, until
I have time to further investigate/implement something like what Tim
showed.

Thanks for everyone's help.

Ben


__._,_.___

--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to