向dojo数据网格添加图标

向dojo数据网格添加图标,dojo,dojox.grid.datagrid,Dojo,Dojox.grid.datagrid,我想在dojox数据网格的列中设置一个图标。我可以像dojo树中那样设置类图标:dijit/treegetIconClass 谢谢也许你应该试试formatter <script> function imgFormatter(s) { return '<img src="' + s + '"/>'; } </script> <table data-dojo-type="dojox.grid.DataGrid">

我想在dojox数据网格的列中设置一个图标。我可以像dojo树中那样设置类图标:
dijit/tree
getIconClass


谢谢

也许你应该试试formatter

<script>
    function imgFormatter(s) {
        return '<img src="' + s + '"/>';
    }
</script>
 <table data-dojo-type="dojox.grid.DataGrid">
     <thead>
         <tr>
              <th field="col" formatter="imgFormatter"></th>
         </tr>
     </thead>
 </table>

函数imgFormatter(s){
返回“”;
}