1 Reply Latest reply on Jul 30, 2008 1:54 PM by Gregory Lafrance

    AdvancedDataGrid - Select/Deselect  All rows

    mg55
      var labelText:String = selectAll.label;
      var mySelection:Boolean = false;


      if (labelText == "Select All")
      {
      selectAll.label = "Deselect All";
      mySelection = true;
      }
      else if (labelText == "Deselect All")
      {
      selectAll.label = "Select All";

      }
      var indexes:Array = new Array();
      for (var i:int=0; i <= currMax; i++)
      {
      if (mySelection)
      {
      indexes.push(i);
      }
      else
      {
      indexes.push(-1);
      }
      }

      hitlistGrid.selectedIndices = indexes.reverse();
      hitlistGrid.setFocus();
      hitlistGrid.validateNow() ;