【问题标题】:How can I sorting the grouped rows based on the count of igGrid from infragistics ignite-ui? (jQuery)如何根据来自 infragistics ignite-ui 的 igGrid 计数对分组行进行排序? (jQuery)
【发布时间】:2019-11-26 13:29:21
【问题描述】:

我使用来自 infragastics ignite-ui 的 igGrid。我已经激活了小部件的“分组依据”功能,效果很好。 GroupByLabel 也有 ASC 和 DESC 排序选项,但通常是字母排序。是否可以以某种方式附加我的排序逻辑?

最重要的是,ASC/DESC 排序发生在分组行的计数(其子行的长度)上,而不是字母顺序。

我没有看到任何方法,当用户按组标签(而不是按列!)排序时触发的事件

我使用的是 jQuery 版本,而不是 Angular。

【问题讨论】:

    标签: infragistics ignite-ui iggrid


    【解决方案1】:

    您可以在比较功能的 columnSettings 中添加自定义 comparingFunction。您可以在此fiddle 中查看有关 comparisonFunction 的文档 here 以及如何使用它的示例。 你可以使用这样的东西:

    features: [
        {
            name: 'GroupBy',
            columnSettings: [
                {
                    columnKey: "ModifiedDate",
                    isGroupBy: true,
                    compareFunc: function (val1, val2, recordsData) {
                        // sort as you need
                    }
                }
            ]
        }
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多