PDA

View Full Version : how do I listen for a CheckCellRenderer event?


toddclare
05-02-2005, 06:23 PM
I have a datagrid with one column using MM's CheckCellRenderer that ships with flash.

I'd like the rest of my movie to react when the user checks an item in the datagrid. I've been looking through the (vague) documentation, and have only managed to give myself a headache.

I'm thinking it's GOT to be something like:
var obj:Object = new Object;
obj.click = function() {
trace ("Someone in the forum helped me");
}
myDataGrid.?? checkBoxInRenderer ??.addEventListener("click", obj);

or something? Thanks!

If you help, I'll put your name in my trace statement for my (three) users to marvel over... ; )

deadbeat
05-02-2005, 06:54 PM
I think what you're looking for is:

var obj:Object = new Object;
obj.cellPress= function() {
trace ("Someone in the forum helped me");
}
myDataGrid.addEventListener("cellPress", obj);


K.

toddclare
05-02-2005, 07:10 PM
this sees to work when I click the cells that do not have CheckCellRenderers, but when I toggle the checkbox in the column using the checkCellRenderer, nothing happens... That's what I'm really looking to intercept -- the "click" event of the chankbox inside the cell renderer...

toddclare
05-02-2005, 07:34 PM
I think I found something that gives me a workaround, but I'm still wondering if it's the right way to go:

var o:Object = new Object();
o.modelChanged = function(evt) {
trace ("Model Changed");
trace (evt.eventName); //traces 'updateField'
trace(evt.firstItem); //traces the index of the item
trace(evt.fieldName); //traces the field name of the column
}
dataGridDataProviderArray.addEventListener("modelChanged", o);

I would hope that i could listen directly to the checkBox, but I can at least get by with this...