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
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
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.
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
Thanks Boyan Dimitrov. Can you update the dojo to trigger a click on the Collapse button?
Thanks.
Hello Balaji,
Please refer to the http://dojo.telerik.com/AhINe/7 example.
Regards,
Boyan Dimitrov
Telerik