2
votes

I understand how to hide a column in Angular UI-grid:

$scope.gridOptions = {      
  columnDefs: [
    { name: 'id', visible : false },
  ],
};

But if I only define which columns I want hidden, the grid automatically assumes that I also define which columns I want to have visible, however this is not the case so this results in an empty grid.

Is it possible to configure the grid to show 'all columns except those configured to be hidden'?

1

1 Answers

1
votes

Yes, it's certainly possible as stated in GridOptions api.

You just need to add excludeProperties instead of columnDefs and assign it an array of strings where every string is a property to hide in your grid.

In your example you should just write:

$scope.gridOptions = {      
  excludeProperties: ['id'],
};