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

267
Vistas
ag-grid - Set cellRendererParams to data.field items so they are usable in cellRenderer

I am working on an AG-Grid using JavaScript and am having difficulty passing additional parameters for use in a cellRenderer using cellRendererParams and valueGetter.

I have stripped this down to get rid of everything else while I troubleshoot what I am doing wrong.

First in my columnDefs I have these two columns (among others)

{ headerName: 'Test Getter', field: 'subType',
        cellRenderer: LinkRenderer,
        cellRendererParams: {
            isNew: true,
            valueGetter: (params) => ({ sizeL: params.data.size, fileNameL: params.data.fileName }),
        },
    suppressMenu: true, resizable: false, width: 120 },
    { headerName: 'Testing2', valueGetter: 'data.size + data.fileName', resizable: true },

And my simple cellRenderer class:

class LinkRenderer {
  init(params) {
    this.eGui = document.createElement('span');
 //   var ext = params.isNew;
    var ext = params.sizeL;
    this.eGui.innerHTML = `${ext}`;
  }

  getGui() {
    return this.eGui;
  }

  refresh(params) {
    return false;
  }
}

There are a couple things to note in my code to hopefully show some tests I have done to make sure I have access to the data, and do have my cellRendererParams working for non-data strings.

  1. The column just below the one in question - that valueGetter is getting the data in those to fields just fine.
  2. The isNew parameter that is added first in cellRendererParams is accessible in the cellRenderer and works fine.

I am not sure where my problem is. I have tried all sorts of different things with the valueGetter that is inside the cellRendererParams, and I have tried all sorts of ways to address the fields in the cellRenderer but everything I try returns undefined.

Any thoughts or ideas?

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