简体   繁体   中英

Adding a line break in JavaScript (full calendar)

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?

Like I already said in my answer above: adding a \\n does the trick!

see: http://jsbin.com/IZoCoJIy/1/

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>");
        }
    }, 

Result结果

Can i revisit this in regards to the full calendar Jquery when being printed and is in multi page form the page breaks mumbles the events right at the point of breaking off into the next page. Is there a know fix for this?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM