I am trying to have my script delete the row completely once the "locatebutton" has been pressed. I have the following code however I cannot seem to get it working right. Yes, the table name within DataTables is named "dataTables-example".
Button:
<td><button type="button" name="locateButton1" class="btn btn-info" onClick="UpdateLocate(<?php echo $orow['wo']; ?>);"/>Locates</button></a></td>
Script:
<script>
function UpdateLocate(wo)
{
jQuery.ajax({
type: "POST",
url: "functions/markLocates.php",
data: 'wo='+wo,
cache: false,
success: function(response)
{
//alert("Record successfully updated");
$('#dataTables-example').on( 'click', 'a.editor_remove', function (e) {
e.preventDefault();
editor
.title( 'Edit record' )
.message( "Are you sure you wish to delete this row?" )
.buttons( { "button": "locateButton1", "fn": function () { editor.submit() } } )
.remove( $(this).closest('tr') );
} );
}
});
}