I had checked this link.
That's a clever idea but isn't for my problem.
My grid has a row number header column and some other row header columns, and these is a switch for only the row number column. How could I remove only row number column when it exists?
i have found a way to do that:
var numColIndex = _.findIndex(gridApi.grid.columns, (c) => c.name === numColDef.name);
if (numColIndex >= 0)
gridApi.grid.columns.splice(0, 1);