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

Aggregate

1 Answer 65 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
Veteran
n/a asked on 18 Nov 2020, 08:14 AM

Hello.

 

I have two questions.

- Is it possible to calculate server side aggregation ?

- Can we only display a global aggregation (total) but not in the TreeList (sub-total)?

 

Thank you.

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 20 Nov 2020, 06:34 PM

Hello Jérôme,

Thank you for contacting Telerik support.

In ASP.NET Core the ServerOperation option is turned on by default. This means the aggregates are calculated on the server and not on the client.

As for the other question, you can utilize the Expand event of the Treelist and hide the footers of the child elements. This way you will only see the footer of the main element.

.Events(ev => ev.Expand("onExpand"))

<script>
function onExpand() {
                      let treelist = this;
                      // Get the number of the last footer.
                      let lastFooter = $(".k-footer-template").length - 1;
                      
                      setTimeout(function() {
                        // Hide every footer except the last one.
                      	treelist.tbody.find(".k-footer-template:not(:eq(" + lastFooter +"))").hide();
                      }, 10)
}
</script>

The setTimeout function is needed because the child footers are rendered after the expand event is triggered.

Here is a live dojo example that demonstrates this functionality.

Let me know in case I misunderstood any of your questions.

Best Regards,
Georgi Denchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
TreeList
Asked by
n/a
Top achievements
Rank 1
Veteran
Answers by
Georgi Denchev
Telerik team
Share this question
or