【问题标题】:Kendo UI for Angular: Sorting, Grouping and Virtual ScrollingAngular 的 Kendo UI:排序、分组和虚拟滚动
【发布时间】:2017-06-08 14:40:07
【问题描述】:

我正在尝试同时使用所有 3 个功能。对于排序,这是用于对数据进行排序的:

this.gridView = {
    data: orderBy(this.products, this.sort),
    total: this.products.length
};

这是用于分组的:

this.gridView = process(products, { group: this.groups });

而且,对于虚拟滚动,这是使用的:

this.gridView = {
    data: this.data.slice(this.skip, this.skip + this.pageSize),
    total: this.data.length
};

如何同时使用所有 3 个?当我为分组添加代码时,它会破坏分组。如果我单击列标题进行排序,它认为我想拖动列标题。当添加用于排序的代码时,虚拟滚动停止工作。使用所有 3 个功能时,应调用哪个函数的优先顺序?

【问题讨论】:

    标签: kendo-ui-angular2


    【解决方案1】:

    我能够找到我需要做的事情。对于其他想要使用所有查询功能的人,只需使用此属性绑定:

    [kendoGridBinding]="gridData"
    

    这将处理分组、分页、排序和过滤。通过使用 kendoGridBinding 指令,网格将为您处理一切。

    【讨论】:

    • 我遇到了同样的问题,但我不明白 kendoGridBinding 如何将它们组合在一起。您不必创建 plunker,但可以将您的组件和 html 作为屏幕截图分享。
    猜你喜欢
    • 2013-04-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-07
    • 2017-01-16
    • 1970-01-01
    相关资源
    最近更新 更多