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

179
Visualizações
Is there a way to return cell data as a tooltip in Tabulator (v5.0.7)

I want to start by saying that I am by no means an expert in JavaScript, so apologies in advance if I am missing something obvious.

Example: I'm trying to create a custom tooltip for column A. Using the data from another cell as the parameter for the output of column A's tooltip.

{title: "title", tooltip: function(cell) {return anotherfunction(cell)}...

When passing 'cell' through as a parameter, it's possible to view the information in the rest of the row console.log(cell._cell) but from what I've discovered, there's no way of accessing the rest of the data.

This is a code pen of the issue that I'm having (i've commented out the console.log(cell._cell.value) in the example, as this will make the table fail to render. So, looking at the browsers console, it's possible to see the data that is returned from console.log(cell._cell).

I've tried to use Tabulators cell.getData(), cell.getRow(), cell.getColumn() etc (and a load of others) but each results in an error.

Codepen https://codepen.io/lukeorriss/pen/yLzMapg

If someone could please point me in the right direction for accessing the data in another row from a tooltip function, this would be great. Thank you all, in advance.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Tabulator use 2 types of definitions for tooltip .

  1. ColumnComponent (Header Cell)
  2. Cell (Data Cell)

So You have to put a condition for your formatTooltip function

function formatTooltip(cell) {
    // Need to open browser console log to view this.
    if (cell._cell) {
        let { name, email, address } = cell.getData();

        return `You are ${name}, your email is ${email} and address is ${address}`;
    } else if (cell.type === "ColumnComponent") {
        return cell.getField();
    }
}

See My Codepen

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