0

I want to display a grid with no filters on the header using angular ui grid.Currently with the below code im getting filters at the column header.

app.controller('MainCtrl', ['$scope','$http', function ($scope,$http) { 
      $scope.gridOptions = {};
      $http.get('data/grid1.json')
      .success(function(data) {
        $scope.gridOptions.data = data;
      });
}]);

Below is the HTML where the grid is loaded

<div id="grid1" ui-grid="gridOptions" class="grid"></div>

here is a sample how it looks like http://ui-grid.info/

Could anybody suggest me how to remove these filters

2 Answers 2

2

If you are trying to remove a filter for a single column only, columnDefs should specify

enableFiltering

I often do this with an extra column that I add for actions:

var actionCol = {
    name: 'Actions',
    width: '90',
    cellTemplate: actionTemplate,
    enableCellEdit: false,
    sortable: false,
    enableFiltering: false
};

Reference: UI-Grid API

Sign up to request clarification or add additional context in comments.

Comments

0

To remove the filter options, you need to configure the grid with enableFiltering: false .

$scope.gridOptions = {
  enableFiltering: false
};

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.