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

kendo text bind with line break?

1 Answer 259 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 19 Jul 2019, 02:03 PM

    Hi,

I am displaying a container with a bunch of info, and I am using conditionals to make some of them appear if certain bools return true. This causes an issue with my formatting though because instead of going to a new line when the text appears, it actually appears next to the text that was already there. Is there a way to add a </br> on the binding of the text?

Basically the below checks if the variable exists is true, and if so it sets the variable string to "Success </br>" so that it will add a line break after the text "Success".

var string = null;
if (exists) {
    string = "Success </br>"
}
var returnStatus = kendo.observable({
    status: success
});
kendo.bind($("#status"), returnStatus);

1 Answer, 1 is accepted

Sort by
0
Steven
Top achievements
Rank 1
answered on 19 Jul 2019, 05:08 PM
Disregard :). I found an answer. Utilizing \n in JS, and style="white-space: pre" in html, I achieved what I wanted.
Tags
General Discussions
Asked by
Steven
Top achievements
Rank 1
Answers by
Steven
Top achievements
Rank 1
Share this question
or