white-space: normal
by valchev
HTML
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.default.min.css">
<script src="http://cdn.kendostatic.com/2012.1.322/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.dataviz.min.css">
<div id="grid"></div>
CSS
#grid {
width: 50%;
margin: 0 auto;
}
.k-grid-header .k-header {
white-space: normal;
}
JavaScript
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
//using jsfiddle echo service to simulate JSON endpoint
url: "/echo/json/",
dataType: "json",
type: "POST",
data: {
// /echo/json/ echoes the JSON which you pass as an argument
json: JSON.stringify([
{ name: "Alex", city: "Miami" },
{ name: "Peter", city: "New York" },
{ name: "Harry", city: "London" }
])
}
}
},
schema: {
model: {
fields: {
name: { type: "string" },
city: { type: "string" }
}
}
}
},
height: 200,
columns: [
{ field: "name", title: "name", width: "150px" },
{ field: "city", title: "A very long city column title for test", width: "150px" }
]
});