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

Update Aggregate on Change with Locked columns

2 Answers 239 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jakub Wilk
Top achievements
Rank 2
Jakub Wilk asked on 06 Sep 2016, 10:19 AM

Hello,

I followed this example of updating aggregates on change:

http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/update-aggregates-on-change

However there is a problem with frozen (locked) columns as shown in this dojo:

http://dojo.telerik.com/oLutu

Note that upon change, ".k-footer-template" is replaced with a "normal" footer i.e. the footer that would be normally displayed if the columns were not locked. The effect is that the cells move to the left.

Is there a way to generate only the footer inside the ".k-grid-footer-wrap" without the locked cells?

Also it appears that method "footerTempalte" in the Grid object is not documented anywhere in the JavaScript api (http://docs.telerik.com/kendo-ui/api/javascript/ui/grid)

2 Answers, 1 is accepted

Sort by
0
Jakub Wilk
Top achievements
Rank 2
answered on 06 Sep 2016, 10:29 AM
I attach two images showing the problem
0
Dimiter Topalov
Telerik team
answered on 07 Sep 2016, 02:38 PM
Hi Jakub,

The issue has already been resolved in another thread, but I will also post the answer here, so others can benefit too:

The footerTemplate() method is not documented, because it is intended for internal use only.

The described behavior occurs, because in locked columns scenarios, to tables (bodies, footers, headers) are created - one for the locked content, and one for the regular one. This leads to two elements with the .k-footer-template class.

The footerTemplate() method on the other hand returns a string for the whole footer regardless of whether there are frozen columns or not.

The described scenario is not supported out-of-the-box, but the workaround is to programmatically get only what you need from the string, returned by the footerTemplate() function, and replace with it the contents of the regular footer template.

I have modified the provided dojo with a sample implementation of the suggested approach:

http://dojo.telerik.com/oLutu/4

Please mind that the involved custom logic should be adjusted accordingly every time the grouping configuration, or the number of locked columns is modified.

Regards,
Dimiter Topalov
Telerik by Progress
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Tags
Grid
Asked by
Jakub Wilk
Top achievements
Rank 2
Answers by
Jakub Wilk
Top achievements
Rank 2
Dimiter Topalov
Telerik team
Share this question
or