Set New Lines in Grid Column From Data
Environment
Product | Progress® Kendo UI® Grid for jQuery |
Product Version | 2017.3.1026 |
Description
How can I set the / n
in the response string and display it in the Grid column without using the template? What do I have to write in the AJAX response?
Solution
To display the text on two lines without implementing the column.template
, use the br
tag.
- Send the tag as part of the response.
- Set
encoding
tofalse
.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name", encoded: false }
],
dataSource: [ { name: "Jane Doe </br> test" } ]
});
</script>