Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda