How to edit/delete datatables server side using python (flask/mysql)?

Solution
// Delete Record from Database.
    var table= $("#datatables").DataTable();
    $("#datatables").on('click',  '[id*=btnDelete]', function(){
    var id = $(this).attr("id_ates");
    if(confirm("Are you sure you want to delete?")) {
        $.ajax({
            "url": "{{url_for('delfiletest', id_ates=5)}}",
            method:"POST",
            data:{id_ates:id},
            success:function(data) {                    
                table.ajax.reload();
            }
        })
    } else {
        return false;
    }
});