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

[Solved] Formatting numbers in grid pager

1 Answer 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rachael
Top achievements
Rank 1
Rachael asked on 17 Sep 2014, 05:47 PM
I'm trying for format the numbers in my grid pager to have commas if necessary.

Relevant snippet:

pageable: {
    pageSizes: [10, 25, 50, 100],
    messages: { display: "{0} - #=kendo.toString({1}, 'n0')# of #=kendo.toString({2}, 'n0')#" },
},

The above doesn't work, it just renders the string as-is, replacing the curly-bracketed values with the appropriate ones from the database but not actually executing the formatting aspect. Any guidance on how to format the numbers?

1 Answer, 1 is accepted

Sort by
0
Rachael
Top achievements
Rank 1
answered on 17 Sep 2014, 05:52 PM
Never mind - I figured it out, but boy does no one ask this question since I couldn't find the answer anywhere and had to deduce from another code base for another project. Anyone looking for an answer, it's:

pageable: {
    pageSizes: [10, 25, 50, 100],
    messages: { display: "{0:n0} - {1:n0} of {2:n0}" },
},
Tags
Grid
Asked by
Rachael
Top achievements
Rank 1
Answers by
Rachael
Top achievements
Rank 1
Share this question
or