我想让我的脚本在“locatebutton”被按下后彻底删除该行。我有以下代码,但似乎无法正常工作。是的,在DataTables中表格名称为"dataTables-example"。
按钮:
<td><button type="button" name="locateButton1" class="btn btn-info" onClick="UpdateLocate(<?php echo $orow['wo']; ?>);"/>Locates</button></a></td>
脚本:
<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') );
} );
}
});
}