GroupFooterTemplate only works during initial load

9 posts, 0 answers
  1. Jaanus
    Jaanus avatar
    26 posts
    Member since:
    Oct 2014

    Posted 21 Jun Link to this post

    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

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    464 posts

    Posted 25 Jun Link to this post

    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.
  3. Jaanus
    Jaanus avatar
    26 posts
    Member since:
    Oct 2014

    Posted 25 Jun Link to this post

    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? 

     

     

  4. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    464 posts

    Posted 25 Jun Link to this post

    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.
  5. Jaanus
    Jaanus avatar
    26 posts
    Member since:
    Oct 2014

    Posted 25 Jun Link to this post

    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

     

     

     

  6. Jaanus
    Jaanus avatar
    26 posts
    Member since:
    Oct 2014

    Posted 25 Jun Link to this post

    Oh, I think I figured it out.

    Just remove the group tag.

     

    https://dojo.telerik.com/oYoVOjAq

  7. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    464 posts

    Posted 27 Jun Link to this post

    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.
  8. Jaanus
    Jaanus avatar
    26 posts
    Member since:
    Oct 2014

    Posted 30 Jun Link to this post

    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

     

  9. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    464 posts

    Posted 03 Jul Link to this post

    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.
Back to Top