Columns in ag-grid:
columnsDefs = [
{
headerName: 'Name',
field: 'name'
},
{
headerName: 'Age',
field: 'age'
},
{
headerName: 'Description',
field: 'description'
}
];
The characters length in description can vary. For example, some row might have just 10 characters and some row might have 50 characters. If I set the column width then, if description has much longer length of characters then some of characters will not be shown.
api.sizeColumnsToFit() will scale the columns to fit the available width of the screen. I wanted to achieve the column 'Description' width to be responsive based on the its row data.