Kendo Angular 2 Grid Filter类似于Excel

时间:2017-08-31 12:28:57

标签: angular kendo-ui kendo-grid kendo-ui-angular2

我们如何使用kendo-angular在网格上实现类似excel的过滤。我无法在文档中找到解决方案。

这是JQuery版本中的功能: http://demos.telerik.com/kendo-ui/spreadsheet/sorting-filtering

编辑1:类似于此的过滤器

enter image description here

2 个答案:

答案 0 :(得分:0)

以下是一个例子:

<kendo-grid-column field="ProductName" title="Product Name">
   <ng-template kendoGridFilterCellTemplate let-filter let-column="column">
     <kendo-grid-string-filter-cell
       [showOperators]="false"
       [column]="column"
       [filter]="filter">
     </kendo-grid-string-filter-cell>
   </ng-template>
</kendo-grid-column>

http://www.telerik.com/kendo-angular-ui/components/grid/filtering/built-in-template/

答案 1 :(得分:0)

以下是一个示例:(在其中的“过滤菜单”选项中。按照倒数第二个示例)

https://www.telerik.com/kendo-angular-ui/components/grid/filtering/reusable-filter/

它的微小变化。有&#39; multicheck-filter.component.ts&#39;文件会给你这个错误:

财产&#39;价值&#39;在类型&#39; FilterDescriptor |上不存在CompositeFilterDescriptor&#39 ;.   财产价值&#39;在&#39; CompositeFilterDescriptor&#39;。

类型中不存在

要解决此问题,您需要在ngAfterViewInit()

中替换以下给定的代码

this.value = this.currentFilter.filters.map(FilterDescriptor =&gt; f.value);

使用下面给出的代码。

this.value = this.currentFilter.filters.map((f:FilterDescriptor)=&gt; f.value);

并导入&#39; FilterDescriptor&#39;来自&#39; @ progress / kendo-data-query&#39;。

相关问题