Matt, Code is below. Can you please take
a look at it and let me know what I am doing wrong? import mx.core.UIComponent import mx.controls.CheckBox class
com.idt.pcmssearch.parametric.renderers.CheckCellRenderer extends UIComponent { var check : MovieClip; var listOwner : MovieClip; var getCellIndex : Function; var getDataLabel : Function; function CheckCellRenderer() { } function createChildren() :
Void { check =
createClassObject(CheckBox, "check", 1, {styleName:this,
owner:this}); check.addEventListener("click",
this); size(); } function size() : Void { check.setSize(20,
layoutHeight); check._x =
(layoutWidth-20)/2; check._y =
(layoutHeight-16)/2; } function setValue(str :
String, currentItem : Object, sel : Boolean) : Void { //check._visible
= (currentItem!=undefined); check.selected =
currentItem[getDataLabel()]; } function getPreferredHeight()
: Number { return 16; } function getPreferredWidth()
: Number { return 20; } function click() { listOwner.editField(
getCellIndex().itemIndex, getDataLabel(), check.selected ); } } Thanks Agha Mehdi From: I’m guessing that you accidentally
have a reference to something that is not being cleared in your renderer.
Remember that the renderer is re-used for many items and as you scroll up and
down it changes position. So maybe there’s an instance variable in your
renderer that’s accidentally staying set, i.e., you’re not clearing
everything that you need to in your setValue method. Matt From: Hi all, I have a weirdo thing going on with this
renderer. When I check the
checkbox in the grid, it automatically selects other checkboxes in the same
grid randomly. The most interesting part is that when I scroll through the
grid, it keeps checking/unchecking the boxes without any reason. Also, when I
have some rows checked and I get new data in the grid, it keeps the boxes
checked at previous indexes. Anyone ever ran into this issue? Thanks Agha Mehdi IDT - eBusiness Program Manager Work: 408.284.8239 Fax: 408.284.2766
|
Title: Checkbox Cell Renderer