3
votes

I want to enable filtering in my grid however I do not want the user to input a value to filter on. Is there a way to hide the filter box for user input? Alternatively is there another way of enabling filtering in the ui-grid?

3

3 Answers

3
votes

http://ui-grid.info/docs/#/tutorial/103_filtering

ng-grid has been rewritten as ui-grid and The filter field can be pre-populated by setting

filter: { term: 'xxx' } in the column def

in the column options declaration. Alternativeliy, ng-grid has a similar setting in the column options declaration

FilterOptions   { filterText: '', useExternalFilter: false }    

filterText: The text bound to the built-in search box. useExternalFilter: Bypass internal filtering if you want to roll your own filtering mechanism but want to use builtin search box

1
votes

Why not just do it through CSS?

.ui-grid-filter-container {
  display: none;
}

It looks okay to me and doesn't leave any blank space below the column header.

0
votes

Simply

$scope.gridOptions = {
    enableFiltering: false
}

with this code you'll have no filters in the header