override updateDisplayList(..) function and set visibility there as
opposed to in set data(...).



--- In flexcoders@yahoogroups.com, "securenetfreedom" <[EMAIL PROTECTED]> wrote:
>
> I am using an ADG with HierarchicalData to group my data. I am using a
> checkbox item renderer that the user can check to archive the row.
> However, the checkbox is diplaying on every row and I need it to
> display only on the sub-set like below:
> 
> Group | Archive | Title  |
> Group1
> ------|-- chk --| Trains |
> ------|-- chk --| Planes |
> Group2
> ------|-- chk --| Autos  |
> 
> I have tried setting the visibility of the Canvas (the base of the 
> checkbox itemrenderer component) in the creationComplete handler and
> in the 'set data' method of the component which works on the first
> pass, but when scrolling the grid or expanding the nodes, results are
> inconsistent. 
> 
> private var _vis:Boolean;
>             // called by creationComplete event
>             public function init():void{
>               var nodeName:String = _listData["item"].name();
>               _vis = (nodeName == "item");                    
>               this.visible = _vis;            
>             }
> override public function set data(value:Object):void {
>                 super.data = value;                
>                 chkbox.selected = (value[_dataField] == "true");
>                 this.visible = _vis;
>             }
> 
> Thanks for your input. 
> 
> Jeff
>


Reply via email to