TrNgGrid显示自定义列过滤器 [英] TrNgGrid display custom column filter
问题描述
我正在尝试添加自定义列过滤器(自动完成,请选择...),但找不到方法.我试图用th的tr-ng-grid-column-filter
属性覆盖默认的过滤器模板,但是它不起作用.标头有所更改(标题不再是粗体),并且完全不使用新模板.
I'm trying to add custom column filter (autocomplete, select ...) but can't find how. I tried to override default filter template with a tr-ng-grid-column-filter
attribute on a th, but it does not works. Header is changed somehow (title is not bold anymore) and the new template is not used at all.
tr-ng-grid-column-filter
到底是正确的方式还是其他方式?
Is the tr-ng-grid-column-filter
right way to do it at all or there is something else?
在服务器上对数据进行排序,分页和过滤,因此它与angular或trnggrid客户端过滤&不存在任何关系.格式化.因此,我只想在某些列上显示其他输入(例如,选择),而不是由网格呈现默认的输入文本.
Data is sorted, paginated and filtered on the server so it does not have any relation to angular or trnggrid client side filtering & formating. So I just want to display some other input on some columns (e.g. select) instead of default input text rendered by a grid.
我在 TrNgGrid 3.0.3
推荐答案
我创建了一个指令以实现自定义下拉过滤器.它本身可以在任何项目中重用,但是它也将为您提供一个很好的工作示例,说明如何通过简单地扩展TRNG网格来实现自己的自定义过滤器.
I created a directive to implement a custom drop down filter. It, in itself, can be reused on any project, but it will also give you a good working example of how to implement your own custom filter by simply extending TRNG grid.
教程: http://www.davidcline.info/2015/08/trnggrid -dropdown-column-filter.html
演示: http://embed.plnkr.co/w39Xt74pippDajyqUIOD/preview
这篇关于TrNgGrid显示自定义列过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!