Keep full length of column headers in AgGrid
P粉311617763
P粉311617763 2023-09-13 13:01:48
0
1
478

How do I tell AgGrid not to shorten my column headers? By default I'd like to be able to see the full column headers when the grid loads and not have to resize them.

P粉311617763
P粉311617763

reply all(1)
P粉469090753

You can specify the minimum width of each column using minWidth a>. You can also set suppressSizeToFit to true to prevent AgGrid from calling api.sizeColumnsToFit(params).

Example:

// for specific column
const columnDefs = [
  { field: 'athlete', width: 150, suppressSizeToFit: true },
  { field: 'age', width: 50, minWidth: 50 },
  { colId: 'country', field: 'country', minWidth: 300 },
  { field: 'year', width: 90 },
];

// for all columns
const defaultColDef = {
  suppressSizeToFit: true
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!