Two possible causes of this:
- The grid isn't ready when you attempt to hide the column. This probably isn't the case as you say the grid has been rendered, but it's worth checking
- You're not using correct column identifier. This can be either a column id or Column object.
It's probably the latter - are you perhaps using the header name instead of the field/col id?
For example, if you have this:
var columnDefs = [
{headerName: "Athlete", field: "athlete", width: 200}
];
Then the first parameter would be 'athlete', not 'Athlete'.
You can additionally specify a colId to rule out any conflicts and then use this id in your api call:
var columnDefs = [
{headerName: "Athlete", field: "athlete", width: 200, colId: "athleteCol"}
];
But this isn't normally necessary.