Storing image in dojo datagrid

2019-07-14 08:19发布

问题:

How to add an image to Dojo datagrid columns?

I have different css classes for different images. How to make it display in datagrid? How to store image in datastore?

回答1:

I would try with a formatter in the layout structure:

var layout = [
   {
       field: 'image', name: ' ', 
       width: 'auto', formatter: function(value) { 
           var src = imageURL; 
           return "<img src=\"" + src + "\" />"; 
       } 
    }];


标签: datagrid dojo