0 Replies Latest reply on Jun 19, 2007 8:39 PM by dennismr

    ItemEditEnd()

    dennismr
      I use itemEditEnd to call an actionscript function:

      itemEditEnd="sizeChange(event)"

      This works fine and the method executes without an error in an IE6 browser but in an IE7 browser I get the Error #1009 error that states "Cannot access a property or method of a null object reference at CreatePairings/sizeChange(). Any idea why this would work for IE6 and not for IE7? Thanks for any help you can offer.

      The sizeChange method is this:

      public function sizeChange(event:DataGridEvent):void{
      // get a reference to the datagrid
      var grid:DataGrid = event.target as DataGrid;
      // get a reference to the name of the property in the
      // underlying object corresponding to the cell that's being edited
      var field:String = event.dataField;
      // get a reference to the row number (the index in the
      // dataprovider of the row that's being edited
      var row:Number = Number(event.rowIndex);
      // get a reference to the column number of
      // the cell that's being edited
      var col:int = event.columnIndex;
      if (grid != null)
      {
      // gets the value (pre-edit) from the grid's dataprovider
      var oldValue:Number = Number(grid.dataProvider.getItemAt(row)[field]);
      // you could also use this line to get the value
      // directly from the cellrenderer that's showing the value
      // in the datagrid -- it's the same value.
      // That way you wouldn't need a reference to the DataGrid.
      //var oldValue = event.itemRenderer.data[field];
      // get the value (post-edit) from the item editor
      var newValue:Number = Number(grid.itemEditorInstance[grid.columns[col].editorDataField]);
      // check if the value has changed

      if (newValue != oldValue)
      {
      if(label1.text.indexOf(dgTeams.selectedItem.strID)>=0){
      dgTeams.selectedItem.strTeamName = "Dup";
      }

      var slts:int = int(Slots.text);
      slts = slts -1;
      Slots.text = slts.toString();
      //dgTeams.selectedItem.strTeamName = "Impossible";
      TeamId = TeamId + dgTeams.selectedItem.strID + "~";
      TeamName = TeamName + dgTeams.selectedItem.strTeamName + "~";
      TeamRank = TeamRank + newValue.toString() + "~";
      label1.text = TeamId;
      label2.text = TeamName;
      label3.text = TeamRank;
      if(slts==0){
      dgTeams.editable = false;
      AvailableTeams.dragEnabled = false;
      btnCreate.visible = true;
      //step5.visible = true;
      btnAddPlayers.visible = false;
      dgTeams.dragEnabled = false;
      dgTeams.dropEnabled = false;
      }
      }

      //lbl2.text = lbl1.text.indexOf(myDG.selectedItem.label1).toString();
      lbl2.text = dgTeams.selectedItem.label1.length.toString();
      //lbl1.text.slice(myDG.selectedItem.label1*,);
      lbl1.text = lbl1.text + "~" + dgTeams.selectedItem.label1 + "~" + newValue.toString() + "^";
      }
      }