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

Is there a list of format strings allowed on Row templates?

2 Answers 249 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cory
Top achievements
Rank 1
Cory asked on 05 Dec 2011, 07:34 PM
The documentation only lists a date format as an example:

$(".k-grid").kendoGrid({
     dataSource
: {
         data
: createRandomData(50),
         pageSize
: 10
     
},
     columns
: [
         
{
             field
: "BirthDate",
             title
: "Birth Date",
             format
: "{0:dd/MMMM/yyyy}" // <- Other formatting options available?
       
}
     
]
 
});

For example, I'm looking to format currency values and long integers (for example vehicle mileage as 24,000 with a comma). I could format on the server but then the sort gets broken since, for example, it sorts currency as a string. Adding smart sorting would be another great solution I've seen elsewhere.

Thanks! Loving KendoUI so far!

2 Answers, 1 is accepted

Sort by
0
Cory
Top achievements
Rank 1
answered on 12 Dec 2011, 03:22 PM
Just a bump. I suspect I'm missing something simple here.
0
Joel
Top achievements
Rank 1
answered on 04 Jan 2012, 09:41 AM
This sample (http://demos.kendoui.com/web/grid/editing.html) should give you an idea of how to format currency (UnitPrice) and numbers (UnitsInStock)
Tags
Grid
Asked by
Cory
Top achievements
Rank 1
Answers by
Cory
Top achievements
Rank 1
Joel
Top achievements
Rank 1
Share this question
or