首页 文章

Kendo Angular 2 Grid Filter类似于Excel

提问于
浏览
2

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

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

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

enter image description here

2 回答

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

  • 0

    下面是一个示例:(在其中的Filter Menu选项中 . 按照倒数第二个示例)

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

    它的变化很小 . 'multicheck-filter.component.ts'文件会给你这个错误:

    类型'FilterDescriptor |上不存在属性'value' CompositeFilterDescriptor” . 类型'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' .

相关问题