Data Render calling a function via class not working

Data Render calling a function via class not working

daniloragodanilorago Posts: 35Questions: 10Answers: 0

Dear all,

I have a render that is showing the content that I want, but when I click on the link to call the function it's not working, what I'm doing wrong?

///// DATA RENDER
{
data: null,
orderable: false,
"render": function (data, type, row, meta){
    return '<a href="javascript:void(0);" class="Btn__Generate" data-generate="<?php echo $_SESSION["ID__Project"]; ?>"><i class="btn btn-icon btn-sm bx bxs-report"></i></a>';
}
},

///// FUNCTION
$(document).ready(function(){
    $(".Btn__Generate").on("click",function(e){
        e.preventDefault();
        var ID = $(this).attr("data-generate");
        var Fcn__Variable = new FormData();
        Fcn__Variable.append('ID', ID);
        Swal.fire({
            backdrop: 'rgba(0,0,0,0.15)',
            background: 'rgba(255,255,255,1)',
            cancelButtonText: 'Cancel',
            confirmButtonText: 'Confirm',
            customClass: {
                cancelButton: 'btn btn-danger no-select',
                closeButton: 'sweet-alert-button-close no-select',
                confirmButton: 'btn btn-success no-select',
                footer: 'sweet-alert-footer text-center no-select',
                htmlContainer: 'sweet-alert-text text-center no-select',
                title: 'sweet-alert-title text-uppercase no-select'
            },
            focusCancel: false,
            focusConfirm: false,
            html: 'Do you want to run the Solution Confirmation Deck report?',
            icon: 'warning',
            showCancelButton: true,
            showCloseButton: false,
            showConfirmButton: true,
            title: 'Report'
        }).then((result) => {
            alert('ok');
        });
    });
});

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.