Currently I have a custom cell renderer that extends CheckBox and implements ICellRenderer.
I've had to override set selected because every time I would select a row in the datagrid, the check box for that row would select, or deselect when moved off of it.
What I'm trying to do is manually select/deselect items from another movieclip (not the mouse click).
The class has a clickHandler in it that would do this, but I can't seem to access it. Calling
ActionScript Code:
myDatagrid.getCellRendererAt(dg.selectedIndex,0).clickHandler()
will throw a 1061: Call to a possibly undefined method clickHandler error.
Below is the class for the custom cell renderer. Any ideas would be appreciated.
ActionScript Code:
package {
import fl.controls.CheckBox;
import fl.controls.listClasses.ListData;
import fl.controls.listClasses.ICellRenderer;
import flash.events.MouseEvent;
public class CboxRenderer extends CheckBox implements ICellRenderer{
public var _listData:ListData;
public var _data:Object;
private var checkComponent:CheckBox;
public function CboxRenderer() {
// constructor code
super();
label = "";
addEventListener(MouseEvent.CLICK,clickHandler);
}
public function set listData(ld:ListData):void{_listData = ld;}
public function get listData():ListData{return _listData;}
public function set data(d:Object):void
{
_data = d;
label = "";
}
public function get data():Object{return _data;}
public function clickHandler(e:MouseEvent):void{
_selected = !_selected;
_data.Available = _selected;
}
override public function get selected():Boolean{return _selected;}
override public function set selected(value:Boolean):void{
_selected = value;
}
}
}