2012-09-28 36 views

回答

2

是的,你可以。但取决于您的要求选择哪种方式。

  1. 使用CSS。当你定义一个栏,设置 'tdCls' 属性:

    { 
        header: 'Image and text column', 
        tdCls: 'img-col', 
        dataIndex: 'Text' 
    } 
    

    在CSS文件:

    td.img-col { 
        background-image: url(images/pic.png); /*16px*/ 
        background-repeat: no-repeat; 
    } 
    
    td.img-col .x-grid-cell-inner { 
        margin-left: 16px; 
    } 
    
  2. 使用模板列:

    { 
        xtype: 'templatecolumn', 
        header: 'Image and text column', 
        tpl: [ 
         '<img src="{ImgPath}"></img>', 
         '<div>{Text}</div>' 
        ] 
    } 
    

    而且你的模型应该有ImgPath物业

+0

非常感谢 求助。 –

相关问题