Adding a line break in JavaScript (full calendar)
12,595
Solution 1
Like I already said in my answer above: adding a \n does the trick!
see: http://jsbin.com/IZoCoJIy/1/
Solution 2
eventRender and try to find a fc-title then append html
events : [
{
"title":"TCC-000004",
"id":"2",
"start":"2019-12-03 09:00:00",
"end":"2019-12-03 00:00:00",
"color":"#730058",
"status":"A",
"description":"Testing Description"
}
],
eventRender: function(event, element) {
// To append if is assessment
if(event.description != '' && typeof event.description !== "undefined")
{
element.find(".fc-title").append("<br/><b>"+event.description+"</b>");
}
},
Comments
-
Millhorn almost 2 years
This is from Adam Shaw's FullCalendar...
How can I put a line break in here so that line two moves to the next line?
events: [ { title: 'Line 1 - This is line 2...', start: '2013-11-07' },
I tried adding one of these,
+'<br />'
, but it didn't work...Thoughts?
-
Millhorn over 10 years7 more long minutes bud. Sorry... Thanks again.
-
Millhorn about 10 yearsI need to see an example of what you're talking about. This calendar works fine for me. I'd also recommend opening up a new question. You're likely to get more answers that way. Respond to this comment with a link to the new question. Thanks.
-
KBriz about 10 years