Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
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 answers
Answer question

0

you just use ng-click instead of onclick

about 4 years ago · Santiago Trujillo Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!