Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
How can I add event listener to span added by DTColumnBuilder?

I am trying to add event onclick to a span added by DTColumnBuilder.

                DTColumnBuilder
                    .newColumn('Invoice')
                    .withTitle('<span class="li-table-header">Invoice</span>')
                    .withOption('visible', true)
                    .renderWith(function (data, type, full) {
                        return `<span style="color: #337AB7;cursor:pointer">Download</span>`;
                    }),

when I try too add onclick (<span onclick="test()" .../span>) I am getting an error saying that test() is not defined even though I have defined test.

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

you just use ng-click instead of onclick

about 4 years ago · Santiago Trujillo Relatório

0

Use below code

<span ng-click="test()" .../span>

If test function is available in the current scope then use this.test() . according to the function scope do the function call

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda