I have a button for deleting one row
<a href="<?php echo base_url('sekertaris_controller/f1_delete/'); echo $row->kode_f1;?>" onclick="return dialog()"><button class="btn btn-danger btn-sm"><i class="fa fa-trash"></i></button></a>
and using javascript dialog() for trigger link
<script>
function dialog() {
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then(function() {
swal(
'Deleted!',
'Your file has been deleted.',
'success'
)
});
}
</script>
the problem is SweetAlert closed and data in row deleted without confirm