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

113
Vistas
Changing the formatter of Icon/Button Columns

Regarding this example here http://tabulator.info/docs/5.0/format#icon

In the cellClick function, how can you change the icon used in the formatter?

The use-case is simply changing a folder icon to folder-open when a cell is clicked.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Fairly simple, track the state in the rowData ...

https://jsfiddle.net/hgwz4knp/

cellClick:function(e, cell){
   let row = cell.getRow();
   let data = row.getData();

   row.update({openClosed:data.openClosed ^ 1});

   this.redraw(true); 
},
formatter:function(cell, fP, onR){
   let data = cell.getData();

   if (data.openClosed == 1){
      return "<i class='fas fa-folder-open'></i>";
   }else{
      return "<i class='fas fa-folder'></i>";
   }
},
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