如何在ng-grid / ui-grid中使用下拉框作为列标题过滤器?

时间:2022-08-24 11:38:20

I am using ui-grid (angular's fast grid system). If I set 'enableFiltering: true', I get an text box under each column header that I can use to filter the grid, awesome. Now I need some or even all of these to be dropdown boxes instead of text boxes, how would I achieve this?

我正在使用ui-grid(angular的快速网格系统)。如果我设置'enableFiltering:true',我会在每个列标题下面得到一个文本框,我可以使用它来过滤网格,真棒。现在我需要一些甚至所有这些是下拉框而不是文本框,我将如何实现这一目标?

e.g. The one column can only have the values 'OK', 'NOK' and 'ABB.'. So I would like to allow the user to filter that column based on only those 3 options.

例如一列只能包含“OK”,“NOK”和“ABB”值。所以我想允许用户仅根据这3个选项过滤该列。

1 个解决方案

#1


2  

You probably should write custom headerCellTemplate in columnDefs.

您可能应该在columnDefs中编写自定义headerCellTemplate。

#1


2  

You probably should write custom headerCellTemplate in columnDefs.

您可能应该在columnDefs中编写自定义headerCellTemplate。