Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide filter box angular ui-grid

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?

like image 747
user2676491 Avatar asked Sep 06 '26 13:09

user2676491


2 Answers

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

like image 64
richbai90 Avatar answered Sep 08 '26 17:09

richbai90


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.

like image 36
Mordred Avatar answered Sep 08 '26 19:09

Mordred