Today I needed to format some data in a KendoUI grid. This is easily done but took me a bit to track it down. I added a template to my column declarations that needed formatting. Then used the kendo.toString formatter method.

var setupGrids = function() {
	$("#headerconditionsGrid").kendoGrid({
		height: 300,
		sortable: true,
		columns: [{
			field: "cond_type",
			title: "Condition",
		}, {
			field: "cond_value",
			title: "Value",
			template: '#= kendo.toString(cond_value, "n") #'
		}, {
			field: "ext_cond_value",
			title: "Extended",
			template: '#= kendo.toString(cond_value, "n") #'
		}, {
			field: "currency",
			title: "Currency"
		}]
	});
}

Leave a Reply

You must be logged in to post a comment.