Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

718
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!