0 Replies Latest reply on Jun 16, 2008 12:27 AM by smscentral

    checkbox renderer

    smscentral
      Hi

      i have a data grid with one of its column having check box as renderer.
      check box is visible for only some rows based on a condition.and this condition is in a function which is called from updateDiaplayList() function.

      but,the checkbox some how appears twice only for the first row in the data grid.

      the condition function is

      public function checkDelPermission():void{
      var checkpermissioninstance:CheckPermission = new CheckPermission();
      checkpermissioninstance.permissions = [8];
      if(data.hasOwnProperty("permission")){
      checkpermissioninstance.permBit = data.permission;
      var delpermission:ArrayCollection = checkpermissioninstance.getPermissions()
      if(delpermission!=null){
      this.logmessage("==== "+data.id+" =========del permisison =="+ delpermission[0]);
      if(delpermission[0]==true){
      this.visible = true;
      }
      else{
      this.visible = false;
      }
      }
      }
      else
      {
      this.visible = false;
      }

      }


      and updatedisplaylist() is

      override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void
      {

      super.updateDisplayList(unscaledWidth,unscaledHeight);
      checkDelPermission();
      var n:int = numChildren;
      for (var i:int = 0; i < n; i++)
      {
      var c:DisplayObject = getChildAt(i);
      if (!(c is TextField))
      {
      c.x = (unscaledWidth - c.width) / 2;
      c.y = 0;
      }
      }
      }

      the log message is printed twice for the first row data..and for all other rows in a datagrid,every thing appears as expected.
      and this happens randomly and not alwayss..

      Thanks
      chandana