Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 04-30-2012, 01:46 PM   #1
veo
Senior Member
 
Join Date: Aug 2007
Posts: 112
Default [AS3] Access Datagrid custom CellRenderer Object

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;         }     }     }
veo is offline   Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:46 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.