Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(function() {
- $(".btnDelete").on("click", function(e) {
- e.preventDefault();
- var nama = $(this).parent().parent().children()[3];
- nama = $(nama).html();
- var tr = $(this).parent().parent();
- $(".modal").modal('show');
- $(".modal-title").html('Konfirmasi');
- $(".modal-body").html('Apa anda yakin ingin menghapus data <b>' + nama + '</b> ?');
- var href = $(this).attr('href');
- $('.btnYa').off();
- $('.btnYa').on('click', function() {
- $.ajax({
- 'url' : href,
- 'type' : 'POST',
- 'success' : function(result) {
- if (result == 1) {
- $(".modal").modal('hide');
- tr.fadeOut();
- toastr.success('Data berhasil dihapus', 'Informasi');
- }
- }
- });
- });
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement