首页 > 解决方案 > kendoGridHeaderTemplate 上的 Kendo-Grid 排序

问题描述

看来,当进度将 kendo-grid 更新到 3.6.1 时,更改日志显示“在单击标题 tem 中的不可聚焦元素时不会发出 sortChange”。

以前,在 3.6.0 及以下版本中,我们使用 kendoGridHeaderTemplate 实现了一些自定义过滤和显示,如下所示:

                    <ng-template kendoGridHeaderTemplate let-dataItem let-columnIndex="columnIndex">
                    <span id="{{col.DisplayName}}-header"></span>
                    {{col.DisplayName}}
                    <span id="filter-popover-button-{{col.DisplayName}}" #filterPopoverButton (click)="col['showColumnFilter']= !col['showColumnFilter']">
                        <i [class]="col['hasFilter']? 'ld-icon filter-blue-active':'ld-icon filter-green'"
                            aria-hidden="true" style="vertical-align:text-bottom;"></i>
                    </span>
                    <kendo-popup *ngIf="col['showColumnFilter']" [anchor]="filterPopoverButton">
                        <span class="pull-right">
                            <button type="button" class="close" aria-label="Close" style="padding: 0px;margin-right: 25px;margin-top: 5px;"
                                (click)="col['showColumnFilter'] = false">
                                <span aria-hidden="true" style="text-shadow: none;">&times;</span>
                            </button>
                        </span>
                        <columnFilter-component [column]="col"></columnFilter-component>
                    </kendo-popup>
                </ng-template>

在此代码中,有一个过滤器图标,可打开带有自定义过滤器/显示的 kendo-popover。现在,当我们升级到 3.7.1 时,单击此图标会导致网格排序/刷新。
我相信这是对上面提到的 3.6.1 的更新。

是否可以在 kendoGridHeaderTemplate 中有一个不触发排序事件的项目?

我们确实希望网格可排序,但不是当他们单击打开过滤器弹出窗口时。

标签: angularkendo-gridkendo-ui-angular2

解决方案


推荐阅读