How to pass an image to a cell?

Satyanarayana asked on June 28, 2019

Hi,
I need to pass an image to a cell data, please help me on how to achieve my req.
 
Thanks,
Satya

1 answer

Public
Vera Didenko Flexmonster July 1, 2019

Hello, Satya,
 
Thank you for writing to us.
 
This can be achieved via the customizeCell() API call.
 
With the customizeCell() API call you can get access to the wanted cells and add an image to them:
 
1) Specify the customizeCell property:
 

customizeCell: customizeCellFunction

 
2) Provide the implementation, for example, the following will add an image to each value cell:
 

function customizeCellFunction(cell, data) {
if (data.value) {
cell.addClass("image");
cell.addClass("imageSpace");
}
}

 
Here is a JSFiddle example for illustration.
 
Please let us know if you have further questions.
 
Best Regards,
Vera

Please login or Register to Submit Answer