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

380
Vistas
How to add attribute using Ag Grid at row and cell level?

Just like we can add CSS class using ag grid. Is there any way in ag grid to add attribute\s at row and cell level.

const gridOptions = {
// all rows assigned CSS class 'my-green-class'
rowClass: 'my-green-class',

// all even rows assigned 'my-shaded-effect'
getRowClass: params => {
    if (params.node.rowIndex % 2 === 0) {
        return 'my-shaded-effect';
    }
},

// other grid options ...

For example I want like "my-custom-attr="dummyValue" below

<div comp-id="44" my-custom-attr="dummyValue" style="transform: translateY(0px); height: 42px;" row-index="0" aria-rowindex="2" class="ag-row-even ag-row-no-focus ag-row ag-row-level-0 ag-row-position-absolute ag-row-first" role="row" row-id="0"><div comp-id="63" class="ag-cell ag-cell-not-inline-editing ag-cell-normal-height ag-cell-value" tabindex="-1" role="gridcell" aria-colindex="2" col-id="sickDays" unselectable="on" style="left: 200px; width: 200px;">4</div></div>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I would look into cell renders. https://www.ag-grid.com/javascript-data-grid/cell-rendering/

You could then add your attr to the cell by returning

return (
    <div my-attr="asdffasdf">
        {params.data.cellValue}
    </div>
)
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