类似于 Excel 的 Kendo Angular 2 网格过滤器 [英] Kendo Angular 2 Grid Filter similar to Excel
问题描述
我们如何使用 kendo-angular 在网格上实现类似 excel 的过滤.我在文档中找不到解决方案.
这是JQuery版本的特性:
这里是一个例子:(在过滤器菜单选项里面.按照倒数第二个例子)
https://www.telerik.com/kendo-angular-ui/components/grid/filtering/reusable-filter/
里面的小改动.'multicheck-filter.component.ts' 文件会给你这个错误:
类型FilterDescriptor"上不存在属性value" |复合过滤器描述符'.类型CompositeFilterDescriptor"上不存在属性value".
要解决它,您需要在 ngAfterViewInit() 中替换下面给定的代码
this.value = this.currentFilter.filters.map(FilterDescriptor => f.value);
使用下面给出的代码.
this.value = this.currentFilter.filters.map((f:FilterDescriptor) => f.value);
并从@progress/kendo-data-query"导入FilterDescriptor".
How can We implement an excel-like filtering on a grid using kendo-angular. I can't find a solution in the documentation.
This is the feature in JQuery version: http://demos.telerik.com/kendo-ui/spreadsheet/sorting-filtering
edit 1: a filter similar to this one
Here is an example: (In Filter Menu option inside it. Follow second-last example)
https://www.telerik.com/kendo-angular-ui/components/grid/filtering/reusable-filter/
Small change in it. There 'multicheck-filter.component.ts' file will give you this error:
Property 'value' does not exist on type 'FilterDescriptor | CompositeFilterDescriptor'. Property 'value' does not exist on type 'CompositeFilterDescriptor'.
To resolve it, you need to replace below given code inside ngAfterViewInit()
this.value = this.currentFilter.filters.map(FilterDescriptor => f.value);
With below given code.
this.value = this.currentFilter.filters.map((f:FilterDescriptor) => f.value);
and also import 'FilterDescriptor' from '@progress/kendo-data-query'.
这篇关于类似于 Excel 的 Kendo Angular 2 网格过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!