DefaultContent with an Image
DefaultContent with an Image
mikedmason
Posts: 39Questions: 12Answers: 0
in General
Hi Guys,
Having a issue trying to get a dynamic image in the defaultcontent. I can hardcode a image src and it works but i want to use the field "image" that contains the image source. I am sure my syntax is wrong. Any help would be greatly appreciated.
Doesn't work
{
data: null,
defaultContent: '<img src="' + editor.field( 'image' ) + '" alt="./img/no-image-icon-15.png",width=60px, height=60px />',
orderable: false
},
Works
{
data: null,
defaultContent: '<img src="./uploads/32.png" alt="./img/no-image-icon-15.png",width=60px, height=60px />',
orderable: false
},
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
columns.defaultContent
is for dynamic content only. Usecolumns.render
if it needs to be dynamic (i.e. checking if there is a value from an Editor API method).Allan
Thank you Alan. Read up and found this worked.