0 Replies Latest reply on May 6, 2008 7:51 AM by nrutter

    Datagrid remove item and update array

    nrutter Level 1
      I have a datagrid that I am removing an item from and I need it to update the array after the item is removed. I have data that displays in other areas of my app so when I remove the item it stays on my other views. How would I update the array after the remove button is clicked inside the datagrid?

      public function deleteProduct(event:Event,data:*):void
      {
      for (var i:int = 0; i < this.instVO.acProd.length; i++)
      {
      var tempProdVO:ProdVO = this.instVO.acProd.getItemAt(i) as ProdVO;
      if(tempProdVO == data)
      {
      this.instVO.acProd.removeItemAt(i);
      this.instVO.acProd.refresh();
      break;
      }
      }
      }