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

Custom Grid Group Aggregate Text

5 Answers 435 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Balaji
Top achievements
Rank 1
Balaji asked on 27 Sep 2015, 06:28 AM

Hello,

 I have the Dojo here.

http://dojo.telerik.com/AhINe

I am grouping by the Product column and Price column is text column which the users can edit the numbers.

I need to do the following:

1. I need to show the total of Price in the Group Header Template.

    For example, the group text now shows ABC (Total Price:4). Instead I want it to show ABC (Total Price: 70)

2. Since the Price column is editable, when the user edits the Price I want the Group header text to change.

I have thousands of records and there can be multiple groups. So I cannot practically refresh the grid to change the datasource.

3. I need to collapse few groups when loading the grid.  I am using a jquery approach and instead I want to be able to do this in angular.

 

Thanks.

5 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 29 Sep 2015, 10:20 AM
Hi Balaji,

There is no built-in functionality that will allow you to achieve your requirements, because within the group header, only the aggregate for the grouped field will be available (in your example, the count for the ProductName group). The "sum" aggregate that you need to display for your price column will be available only within the footer item, as demonstrated in the following dojo example:
As for your second requirement, even if you manage to manually calculate the price total for each group and insert the value in the group header, you will have to handle the blur event of each input element that you have in your template and recalculate the total in the group header.

Hope this helps.


Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Balaji
Top achievements
Rank 1
answered on 29 Sep 2015, 01:02 PM

Thanks Konstantin for your reply.

I have a custom template and am handling the onblur event. Is there anyway I can calculate the price and insert the value in the group header? I can go, find the group header elements by css class and then modify the inner text of those html elements.

What about my 3rd question? collapsingGroups in an angular way? because if i go with this jquery approach, it does not work in firefox.

0
Boyan Dimitrov
Telerik team
answered on 01 Oct 2015, 03:51 PM

Hello Balaji,

 

An easy way to recalculate the aggregates and display the updated values is to call refresh method of the Kendo UI Grid. 

 

In order to collapse/expand groups the click event of the expand/collapse arrows should be triggered. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Balaji
Top achievements
Rank 1
answered on 01 Oct 2015, 07:37 PM

Thanks Boyan Dimitrov. Can you update the dojo to trigger a click on the Collapse button?

 

Thanks.

0
Boyan Dimitrov
Telerik team
answered on 05 Oct 2015, 10:03 AM

Hello Balaji,

 

Please refer to the http://dojo.telerik.com/AhINe/7 example. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Balaji
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Balaji
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or