How do I display HTML tags as Plain Text in columns?
How do I display HTML tags as Plain Text in columns?
I went through similar questions. But I could not find the correct answer. If the user inputs Notes with HTML content in it, how do I display the entire HTML content as text? For example: If Notes contains '5 is > then 3 but < than 8', it should show verbatim as '5 is > then 3 but < than 8' without escaping the '<' and '>'.
I am using MVC as the backend and I return a JSON result to populate the data table.
I want to render the Notes column below with the saved HTML content .
Thanks
"columns": [
{"data": "Notes", },
{"data": "ID", "orderable": false, "render": function (data) {
return '<a class="actionLink" href="save/' + data + '">Edit</a>'; } },
{"data": "ID", "orderable": false, "render": function (data) {
return '<a class="actionLink" href="delete/' + data + '">Delete</a>'; } },
],
Answers
Use the text renderer.
Allan
Thanks Allan! I did and it worked!!