How to delete current row with jquery datatable plugin How to delete current row with jquery datatable plugin jquery jquery

How to delete current row with jquery datatable plugin


Try this:

var row = $(this).closest("tr").get(0);oTable.fnDeleteRow(oTable.fnGetPosition(row));

If it doesn't work, check the following example


Let's say you attached a function to be called when the user clicks on the button. The function would be something like this

function DeleteRow(event){  //get the row of the cell that is clicked  var $row = $(this).parents("tr").eq(0)  //if you need the id you can get it as  var rowid = $row.attr("id");  //now you can call delete function on this row  $row.delete(); }


How about this:

    // Delete Row    $('.glyphicon-minus').on("click", function() {        configTable.row($(this).closest("tr").get(0)).remove().draw();    });