Accessing "group" aggregate in GroupFooterTemplate using function notation.

1 Answer 86 Views
Grid
Jeremiah
Top achievements
Rank 1
Jeremiah asked on 21 May 2021, 09:19 PM | edited on 21 May 2021, 09:51 PM

In the this documentation, you define a 'group' field that stores three fields - fieldvalue and items. However, I am having trouble accessing this object in function notation. 

            let IsActive: kendo.ui.GridColumn = {
                field: "IsActive",
                title: "Active",
                aggregates: ["group"],
                template: `<span data-columnName="IsActive">#= IsActive #</span>`,
                groupFooterTemplate: (data: any, group: any) => {

                    return group.items[0].Name
                }
            }

See that 'group' is not defined in this context. How can I reference this in function notation?

Jeremiah
Top achievements
Rank 1
commented on 21 May 2021, 09:20 PM

Note: Data IS defined but does not include any group information.

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 26 May 2021, 10:30 AM

Hi, Jeremiah,

When the groupFooterTemplate is declared as a function, the group field can be accessed through the data field itself.

groupFooterTemplate: (data: any) => {
     
    let group = data.IsActive.group;

    return group.items[0].Name
}

Example in Dojo: https://dojo.telerik.com/@gdenchev/EmOduyer 

Best Regards,
Georgi Denchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Jeremiah
Top achievements
Rank 1
Answers by
Georgi Denchev
Telerik team
Share this question
or