Thanks Jesse.

What do you mean by make the events bubble?  I know I can do 
listOwner.dispatchEvent - it's what I'm doing now - but is there a better 
way than accessing the listOwner?  By better I mean accessing the 
listOwner's method feels wrong somehow ...

I tried using editField but it causes all items in the list to get 
updated, or at least all cellrenderers get their setValue called. 
Instead, I'm accessing 
listOwner.getItemAt(getCellIndex().itemIndex)[getDataLabel()] to write 
values.  Then I'm triggering the change event through dispatchEvent.  That 
works and avoids the multiple calls to setValue.

Do you see any issues with that?


Derek Vadneau

----- Original Message ----- 
From: "JesterXL" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Wednesday, January 25, 2006 2:15 PM
Subject: Re: [Flashcoders] Cellrenderer confirmation


For the event part, CellRenderers have access to both the cell and list 
they
are in.  So, if you do this.listOwner; that's the DataGrid.  You can 
either
dispatch events and make them bubble, or dispatch them from the DataGrid's
scope; listOwner.dispatchEvent.

Additionally, if you want to update the dataProvider's data, easiest way 
is
to use editField.  For example, if your cell renderer has a CheckBox in 
it,
in the click event, you could do:

var lbl:String = getDataLabel();
var index:Number = getCellIndex().itemIndex;
listOwner.editField ( index, lbl, my_ch.selected);


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to