Showing the image of an object in the data grid table

My objects have all an image (like a profile photo) and I want to show them in the data grid like the attributes. How can I do that? In my case I have a data grid with a different entity which is associated to the image entity. In this specific data grid want to view the related image.
4 answers

Hackish solution:

Extract GUID for System.image derived entity into extra attribute using java:

return String.valueOf(this.par_obj.getId().getGuid());

Add collumn to datagrid with GUID attribute printed out. (say collumn 5);

Use the following CSS to hide the text of that collumn:{

Use the following continually executing java script to add backgrounds to the td that are the images of the System.Image:

var intervalID = setInterval(function(){
    var a=$("");
    for(var i=0;i<a.length;i++){
        var str_GUID=$(a[i]).attr("title");
        var str_imgURL="http://localhost:8080/file?guid="+str_GUID+"&thumb=true&changedDate=1462275795622";
        var str_CSS="background:url(\""+str_imgURL+"\");background-position:top left;background-size:auto 100%;background-repeat:no-repeat;";
}, 500);

End result: alt text


Hi Shabbaz,

This is all explained here:

Edit: If you have the dataview selected in the modeler you can place a second dataview into it. You should now see the association to the image entity. If I remember correctly you can pretty much drag & drop the image entity on this nested dataview.

Cheers, Gonzo


The short answer to your question is "No, you can't." Data grids are intended to display a lot of simple data in a table, which definitely does not include images.

Your best bet is most likely to replace your data grid with a list view. As long as you keep you list view at a single line you should have much the same effect. You can then use an image viewer in exactly the same way you would in a data view.


Thanks all, I found out that the Template Grid offers the best solution. It looks more like the Data grid than the List view. Thanks again for helping and sharing info.