title: work of link is not proper
body: <p>I am adding multiple rows in datatable with edit and delete link.Suppose I delete 3rd row and after that I edit the 5th row at that time edit link called function which is written on onclick event of delete link.
  Here I am adding add,edit and delete functions of my code.</p>
  
  <pre><code>function addproduct() {
  
      if (document.getElementById("p_barcode").value == "" || wrongdata == false) {
          alert("Please Enter valid value of Barcode..!!!");
          return false;
      } else {
          var barcode = document.getElementById("p_barcode").value;
          var quantity = document.getElementById("p_qnty").value;
          var grossamount = document.getElementById("p_grossamount").value;
          var basetax = document.getElementById("p_basetax").value;
          var additionaltax = document.getElementById("p_additionaltax").value;
          var discount = document.getElementById("p_discount").value;
          var netamount = document.getElementById("p_netamount").value;
          var paidamount = document.getElementById("p_paidamount").value;
  
          var data = barcode + "," + quantity + "," + grossamount + "," + basetax + "," + additionaltax + "," + discount + "," + netamount + "," + paidamount;
  
          alert(data);
  
          var productdata = data.split(',');
          var table = $('#addpurchase').DataTable();
  
          table.row.add(
          [
          productdata[0],
          productdata[1],
          productdata[2],
          productdata[3],
          productdata[4],
          productdata[5],
          productdata[6],
          productdata[7],
          productdata[8] = "&lt;a href='#' onclick='return rowedit();'&gt; Edit &lt;/a&gt; / &lt;a href='#' onclick='return rowdelete();'&gt; Delete &lt;/a&gt;"])
              .draw();
  
          document.getElementById("p_barcode").value = "";
          document.getElementById("p_qnty").value = "1";
          document.getElementById("p_grossamount").value = "";
          document.getElementById("p_basetax").value = "";
          document.getElementById("p_additionaltax").value = "";
          document.getElementById("p_discount").value = "";
          document.getElementById("p_netamount").value = "";
          document.getElementById("p_paidamount").value = "";
  
          return false;
      }
  
  }
  
  function rowdelete() {
  
      var table = $('#addpurchase').DataTable();
  
      $('#addpurchase tbody').on('click', 'a', function () {
          var tr = $(this).closest("tr");
          var rowindex = tr.index();
          //alert(rowindex);
          table.row(rowindex).remove().draw(false);
      });
      return false;
  
  }
  
  function rowedit() {
  
      var table = $('#addpurchase').DataTable();
  
      $('#addpurchase tbody').on('click', 'a', function () {
          var tr = $(this).closest("tr");
          var rowindex = tr.index();
          alert(rowindex);
          var fetchdata = table.row(rowindex).data();
          alert(table.row(rowindex).data());
  
          document.getElementById("p_barcode").value = fetchdata[0];
          document.getElementById("p_qnty").value = fetchdata[1];
          document.getElementById("p_grossamount").value = fetchdata[2];
          document.getElementById("p_basetax").value = fetchdata[3];
          document.getElementById("p_additionaltax").value = fetchdata[4];
          document.getElementById("p_discount").value = fetchdata[5];
          document.getElementById("p_netamount").value = fetchdata[6];
          document.getElementById("p_paidamount").value = fetchdata[7];
  
          table.row(rowindex).remove().draw(false);
  
      });
      return false;
  
  }
  </code></pre>