본문 바로가기
javascript

[dataTables.js] remove 버튼 만들기

by 바나냥 2020. 4. 22.
var myTable = $('#table_02').DataTable();
$(document).on('click', 'a.remove-row', function (e) {
    e.preventDefault();
    var rows = $(this).closest('tr');
    bootbox.dialog({
        message: '<h4 class="mb-10">삭제하시겠습니까?</h4>',
        buttons: {
            main: {
                label: "취소",
                className: "btn-default",
                callback: function callback() {}
        	},
            danger: {
                label: "확인",
                className: "btn-primary",
                callback: function callback() {
                    rows.remove();
                }
            }
        }
    });
});

댓글