Kendo Angular 2 Grid Filter similar to Excel

随声附和 提交于 2019-12-10 11:23:13

问题


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


回答1:


Here is an example:

<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/




回答2:


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'.



来源:https://stackoverflow.com/questions/45981486/kendo-angular-2-grid-filter-similar-to-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!