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

Angular and column footerTemplate

2 Answers 243 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
Scott Waye asked on 01 Feb 2017, 04:22 PM

Hi, Is it possible to have the footerTemplate call a function in the Angular controller?  So in the controller (using controllerAs) you have a function and the template looks something like:

 

                    columns: [
                        {
                            field: "locationCode1",
                            title: "John",
                            width: 200,
                            footerTemplate: "<div>Total Days Worked: #: vm.getTotal() #</div>"
                        },

 

where vm is the controller set using controllerAs and getTotal is the function in the controller.  I've tried #; and #= and I cant get it to find "vm", so it appears its not evaluated in the right scope, maybe there is a field in the scope which will get me to the controller?

2 Answers, 1 is accepted

Sort by
0
Accepted
Boyan Dimitrov
Telerik team
answered on 03 Feb 2017, 12:38 PM

Hello,

I would suggest to use the ng-bind directive as shown in the http://dojo.telerik.com/OPOR/34 example. 

Regards,
Boyan Dimitrov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 03 Feb 2017, 04:57 PM
Thanks, that's what I was after.
Tags
Grid
Asked by
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Boyan Dimitrov
Telerik team
Scott Waye
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or