Using mRender on a column with HTML
Using mRender on a column with HTML
Tronik
Posts: 122Questions: 28Answers: 1
in Extensions
Hi!
I have an issue with implementing the responsive extension to my datatable. When the table collapses into responsive design the link will not show, but only the "data" variable
Im using the following function to create a link in the column:
{
"mData": "id",
"sClass": "center",
"mRender": function (data, type, full) {
return '<a href="" class="editor_edit">Change</a> / <a class="update" href="php/update.php?id=' + data + ' ">Update</a>';
}
}
I can provide a test case if thats needed, but I thought maybe someone was already familiar with the issue.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Yup you are right. It is the raw data that is displayed rather than the rendered data.
There isn't currently a way around this other than to create your own child renderer (
responsive.details.renderer
) and have it read the rendered value from the HTML.Something I'll look into adding in a future version.
Allan
Ok, thank you!
If you dont mind me asking a related question...
How can I word-wrap the cells in the responsive container?
Use
white-space: normal;
in the CSS I would imagine. Targeting whatever cell / row / element, etc that you need.Allan
Added this to the css and it worked, thanks!
td.child {
white-space: normal;
}