0 Replies Latest reply on Jan 15, 2009 5:12 PM by flexstone

    advancedDataGrid isItemSelected  ?

    flexstone Level 1
      I am trying to modify an itemrenderer used previously for dataGrid in a new AdvancedDataGrid. I am not having much luck getting the listData.owner .......here is a section of the code - please set me straight as to what I am doing wrong.

      dataProvider is a GroupingCollection.....

      <mx:dataProvider>
      <mx:GroupingCollection id="gc" source="{myPubsAC}">
      <mx:grouping>
      <mx:Grouping>
      <mx:GroupingField name="type"/>
      </mx:Grouping>
      </mx:grouping>
      </mx:GroupingCollection>
      </mx:dataProvider>



      Thanks

      itemRenderer snippet.............

      import mx.controls.AdvancedDataGrid
      import mx.controls.AdvancedDataGridBaseEx
      import mx.controls.advancedDataGridClasses.AdvancedDataGridListData
      import mx.controls.advancedDataGridClasses.AdvancedDataGridBaseSelectionData

      private var _data:String;
      private var _listData:AdvancedDataGridListData
      private var thisApp = mx.core.Application.application
      private var adg;

      private var _list

      override public function set data(value:Object):void{
      super.data = value;
      if(value){
      this._data = value.toString();
      }
      }

      public function get listData():AdvancedDataGridListData{
      return _listData;
      }

      public function set listData(value:AdvancedDataGridListData):void{
      _listData = value as AdvancedDataGridListData;
      }


      override protected function updateDisplayList(uw:Number,uh:Number):void{
      super.updateDisplayList(uw,uh);

      adg = AdvancedDataGrid(_listData.owner) // always null ????

      if(adg){
      if(adg.isItemSelected(data)){
      cur.alpha = 1
      }

      if(adg.isItemSelected(data)==false){
      cur.alpha = .2;
      }
      if(data.mzID == thisApp.master.default_mzID){
      fav.alpha = 1;
      }else{
      fav.alpha = .2;

      }

      }
      }