angular-ui-grid

Is it possible to remove one row header column from angular ui-grid?


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?

enter image description here


Solution

  • 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);