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

714
Vistas
How to resize columns in ag-grid

I am new to ag-grid. As seen in the screenshot below, I have 4 columns initially. When I remove column 3 (test3), notice that there is space on the right that indicates that a column in missing. How can I ensure that once a column is removed, that the remaining 3 columns (in this case) will fill the area? I tried to pass resizable : true into defaultcolDef but that did not fix the issue...

Intial View

View once Test 3 column is filtered out

about 4 years ago · Santiago Gelvez
2 Respuestas
Responde la pregunta

0

Use flex: 1 on each column.

See the documentation here for more info: https://www.ag-grid.com/javascript-data-grid/column-sizing/#column-flex

Or checkout this plunker example: https://plnkr.co/edit/7evoWXCM1sChDBmX

Just drag one of the columns out of the grid to see it working

about 4 years ago · Santiago Gelvez Denunciar

0

You can use the columnVisible-event to catch any columns added or removed

https://www.ag-grid.com/javascript-data-grid/grid-events/#reference-columns-columnVisible

and then call

gridOptions.api.sizeColumnsToFit();

https://www.ag-grid.com/javascript-data-grid/column-sizing/#size-columns-to-fit

about 4 years ago · Santiago Gelvez 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