How to add newline to Message?

How to add newline to Message?

tangerinetangerine Posts: 3,366Questions: 40Answers: 395

I have this code under an inline "Delete" button:
$('#datatable').on('click', 'td.editor-delete button', function (e) {

    // Get the row data.
    var td = $( this ).closest( 'td' );
    var rowdata = oTable.row( td ).data();

    var details = '"' + rowdata.Songs.title_for_display + '"' + " (Id: " +rowdata.Songs.song_id + ")";

    oEditor.remove($(this).closest('tr'), {
        title: 'Delete record',
        message: "Are you sure you want to remove this record?" + "\r\n" + details,
        buttons: 'Delete'
        });
    });    

The message and details are shown, but the newline is ignored. I have used this newline elsewhere in js with no problem. Is there anything different about "message" in this example?

Answers

  • kthorngrenkthorngren Posts: 22,241Questions: 26Answers: 5,116
    edited August 23

    Looks like that message is shown in a modal. In that case use the HTML <br> like this:

    message: "Are you sure you want to remove this record?" + "<br>" + details,
    

    Kevin

Sign In or Register to comment.