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

165
Views
No Link when null value (Using labels) - Tabulator

I'm using Tabulator 5.1 and it's been great so far. However I have a question that I hope is a quick answer.

I'm loading my data via AJAX, but I have a link column that I need help with. The link formatter works great and I set the "label" property so I can have them all uniform. However, I found that some of my rows coming into the table don't have a URL and when you use the label property it creates it for every row regardless of if there is a URL for it to make a link or not.

So my issue is that I have a column with links and some will send the user to the URL and others are "undefined" (null value from the AJAX call) and so they present an error page.

My question (finally) is, is there a way to blank out the rows that have a Null value while still being able to use the "label" property?

If I remove the "label" property the rows that don't have a URL blank out as expected, it's only when I try to use a label do I run into this issue.

EDIT: So I looked around some more and found a couple of things on the formatter. I see you can use a function to get the label however I can't see to get the logic working right. Here's what I've got so far that I'm trying to play around with:

label: function(cell){
          if (cell.getData().title == "null"){
            return ""
          } else {
            return "Click Here"
          }
        },

However that still only seems to get "Click Here" for every row.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Looks like I found outdated information. This is the code I used to get a custom label while still being able to leave the rows with blank URLs as a blank cell:

formatterParams: {
        label: function(cell){
          if(cell.getValue() == null){
            return ""
          } else {
            return "Click Here"
          }
        },
        target: "_blank"
      },

That's my entire formatterParams value in case anyone needs it. I swore I had tried getValue() before, but this time it worked. Hopefully this helps someone in the future if they need this same thing.

about 4 years ago · Juan Pablo Isaza 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!