Why does my onclick event mark me as undefined in my datatble?

0

What I want to do is call an onclick event with different parameters in each of my rows.

Datatble Code:

    $('#MainContent_tabla').DataTable({
        columns: [
            { title: "Nombre" },
            { title: "Id del Usuario" },
            { title: "Lectura de QR" },
            { title: "Toma de evidencia" },
            { title: "Placas" },
            {
                title: "Imagen", "mRender": function (data, type, full) {
                    return '<center><i class="fa fa-picture-o" aria-hidden="true" style="font-size:24px;cursor:pointer;" onclick="' +ShowPopup(full[3],"background1") + '"></i></center>';
                }
            },
            { title: "Diferencia" }
        ],
        "language": {
            "lengthMenu": "Mostrar _MENU_ Registros por pagina",
            "zeroRecords": "No hay ningun registro que coincida",
            "info": "Mostrando pagina _PAGE_ of _PAGES_",
            "infoEmpty": "No hay registros disponibles",
            "infoFiltered": "(filtered from _MAX_ total records)",
            "search": "Buscar Palabra:",
            "paginate": {
                "previous": "Siguiente",
                "next": "Anterior"
            },
            "processing": true,
            "serverSide": true,
            "ajax": "ConsultarEvidencia.aspx.cs",
            "deferLoading": 57
        }
    });

Result in the element inspector:

    
asked by David 22.05.2018 в 19:09
source

1 answer

1

In this case you want the name of your function to be part of the chain. The correct way would be like this:

onclick="ShowPopup('+full[3]+',\'background1\')"></i></center>';
    
answered by 22.05.2018 в 19:29