This is a migrated thread and some comments may be shown as answers.

GroupFooterTemplate only works during initial load

8 Answers 284 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jaanus
Top achievements
Rank 1
Jaanus asked on 21 Jun 2018, 02:36 PM

GroupFooterTemplate works during load, but after removing the age from header and readding, the grid crashes.

Any suggestions?

 

Example in following link.

https://dojo.telerik.com/EhIkExel/2

8 Answers, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 25 Jun 2018, 05:59 AM
Hello, Jaanus,

Thank you for the provided runnable Dojo.

The Kendo UI Grid column definition should also have its aggregates option defined so that the aggregate is available at all times:

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.aggregates

When the columns.aggregates.sum is added, the work works without errors during grouping and ungrouping:

https://dojo.telerik.com/@bubblemaster/OzipEsIH

We have an issue logged for this particular use case and once that issue is fixed, it will not be necessary to have the aggregates in the column as well:

https://github.com/telerik/kendo-ui-core/issues/3522

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jaanus
Top achievements
Rank 1
answered on 25 Jun 2018, 09:20 AM

Thanks, this was helpful

I was looking at the example https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.groupfootertemplate

Actually I am trying to get the groupFooterTemplates, but is there a way to have the templates without having it grouped as default? 

 

 

0
Alex Hajigeorgieva
Telerik team
answered on 25 Jun 2018, 10:04 AM
Hi, Jaanus,

The Kendo UI Grid groupFooterTemplate and footer template are separate options of the grid and the groupFooterTemplate is generated when the grid is grouped only. Whereas the footer template is always shown. Can you let me know what is the desired outcome for the behaviour and appearance of the Kendo UI Grid so I can give you the most suitable suggestion for your case?

Look forward to hearing back from you.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jaanus
Top achievements
Rank 1
answered on 25 Jun 2018, 10:29 AM

Thanks.

What I want is groupFooterTemplates defined, but not shown/grouped on grid initialization, but only when person groups it by herself.

So exactly as your example is, but it should look like this when loaded.

 

https://imgur.com/a/fZqLZ8B

 

 

 

0
Jaanus
Top achievements
Rank 1
answered on 25 Jun 2018, 10:34 AM

Oh, I think I figured it out.

Just remove the group tag.

 

https://dojo.telerik.com/oYoVOjAq

0
Alex Hajigeorgieva
Telerik team
answered on 27 Jun 2018, 08:47 AM
Hi, Jaanus,

You are correct in your observation -  the groupFooterTemplate is only visible when the Kendo UI Grid is grouped while the footer is always visible.

Should you have further questions, please feel free to get back to me.

Regards,
Alex Hajigeorgieva
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Jaanus
Top achievements
Rank 1
answered on 30 Jun 2018, 11:32 AM

Thanks Alex

 

I followed your example, but having trouble with 2 column groupings.

It is giving me error "Uncaught TypeError: Cannot convert undefined or null to object" during initialization.

 

When I remove the title from grouping and drag it back to top, then it works.

Any suggestions how to fix that error? I have the aggregates: ["average"] set at columns.

 

https://dojo.telerik.com/oYoVOjAq/2

 

0
Alex Hajigeorgieva
Telerik team
answered on 03 Jul 2018, 03:35 PM
Hi, Jaanus,

Thank you for the provided Dojo.

The reason for the error is the missing data source group aggregates. If the initial desired state is grouped, we need to explicitly add the aggregates that are going to be used in the template, to the data source definition:

group: [{
  field: "age",
  aggregates: [ { field: "age", aggregate: "average" }, { field: "title", aggregate: "average" }]
}, {
  field: "title",
  aggregates: [{ field: "title", aggregate: "average" },{ field: "age", aggregate: "average" }]
}]

https://dojo.telerik.com/@bubblemaster/aHIzukeM

For a more comprehensive example, check out the official demo at:

https://demos.telerik.com/kendo-ui/grid/aggregates 

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Jaanus
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Jaanus
Top achievements
Rank 1
Share this question
or