Replace text for imagen
Replace text for imagen
hercross
Posts: 12Questions: 5Answers: 0
Hi, I'm using Datatable, in some columns I have a 1 or a 0, and I want to replace this 1 or 0 in an imagen..
It is possible?
With html table I know how to do it, but with DataTable not..
Thanks
This discussion has been closed.
Answers
Use columns.render
Here is an example (not with an image but it works the same way).
https://datatables.net/examples/advanced_init/column_render.html
I use this to render font awesome icons in conjunction with hyperlinks that I read from a database
Thanks for answered to me...
I'm newbie.. and How would it be to change/replace a 1 to ok.png, for example?
Thanks
Well just use an if statement and return the path to your picture in the renderer. You can see that in this file upload example as well:
https://editor.datatables.net/examples/advanced/upload.html
This might be worth looking at too: https://datatables.net/forums/discussion/comment/120752