Columns.render pass DOM element instead of string.
Columns.render pass DOM element instead of string.

Any way to pass a DOM element instead of a string in the columns.render parameter when using the function variant?
If not, any suggestions on how to implement complex buttons in cells that can toggle their icons or show modals?
I would prefer not having to use the onlick attribute on the button and defining the behaviour in a string.
I tried creating DOM elements and returning the outer html. but the onClick attribute is not kept when converting to string.
This question has an accepted answers - jump to answer
Answers
I'm not clear on exactly what you are trying to do. Are you trying to place buttons in the table rows? If so I believe I seen where others have had problems using onclick, could be wrong though. I would recommend using jQuery delegated events for this. Maybe one of these examples will help:
Buttons with
columns.defaultContent
:http://live.datatables.net/xijecupo/1/edit
Buttons with
columns.render
:http://live.datatables.net/qemodapi/1/edit
If this is off base or doesn't help please provide an example of what you are doing.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin