fnDeleteRow By ID Always Deleting First Row?

fnDeleteRow By ID Always Deleting First Row?

pspsalespspsales Posts: 2Questions: 1Answers: 0

fnDeleteRow seems to always be deleting the first row in my table even though I am calling to delete a row by its element ID:
var RowID = "#campaign-" + CampID; alert("Deleting Row: " + RowID); var oTable = $('table.sorting').dataTable(); oTable.fnDeleteRow(document.getElementById(RowID));

I have uploaded a live example of the issue I am facing here:
http://app-haven.com/datatable/

The live version also shows, E.g. "Deleting Row: campaign-7" whereas whatever number is selected it will always delete the first row onwards.

Any ideas where I am going wrong here?

Answers

  • pspsalespspsales Posts: 2Questions: 1Answers: 0

    A quick update:
    The issue was:
    var RowID = "#campaign-" + CampID;
    oTable.fnDeleteRow(document.getElementById(RowID));

    ^^ No # needed:
    var RowID = "campaign-" + CampID;

    A new issue is that nothing works after the dnDeleteRow line, E.g.
    var RowID = "campaign-" + CampID;
    oTable.fnDeleteRow(document.getElementById(RowID));
    alert("why am I not showing?");

This discussion has been closed.