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

717
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 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