1

I use the igGrid from infragastics ignite-ui. I have activeted the 'group by' feature of the widget which works fine. The GroupByLabel has an ASC and DESC sorting option too but usually it is alphabetic sorting. Is it possible to attach somehow my sorting logic for that?

The most important is that ASC/DESC sorting happens on the count of the grouped rows (length of their children) instead of the alphabetic order.

I did not see any method, event which is triggered when the user sorting by the group label (and not by the columns!)

I use the jQuery version and not the Angular.

Dabagab
  • 2,497
  • 4
  • 26
  • 31

1 Answers1

3

You can add your custom comparingFunction in columnSettings of the compare feature. You can check the documentation here about the comparingFunction as well as a sample how to use it in this fiddle. You can use something like this:

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