Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to right align values of footerTemplate in kendo grid?

I have a kendo grid and i am using footerTemplate to find the sum of values in the grid.I have aligned the values of columns in the grid successfully.My question is how to align the values in footerTemplate The following is the code i am using

{ 
    field: "covered_amount",
    width: "150px", 
    title: "Covered",
    sortable:false,
    attributes:  { style:"text-align:right;" },
    footerTemplate:"#= sum # "
},

Any help is much appreciated.

like image 866
Deepu Avatar asked Mar 20 '13 10:03

Deepu


1 Answers

Define the footer template as:

footerTemplate: "<div style='float: right'>#= sum #</div>"

or:

footerTemplate: "<div style='text-align: right'>#= sum #</div>"

and you can even format it using kendo.toString, Example:

footerTemplate: "<div style='float: right'>#= kendo.toString(sum, 'c2') #</div>"
like image 127
OnaBai Avatar answered Nov 15 '22 10:11

OnaBai