ext grid 单元格提示 出现图片

代码简单 只是记录一下

 

  <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=gbk">
        <title>03.grid</title>
        <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
        <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
        <script type="text/javascript" src="../../ext-all.js"></script>
        <script type="text/javascript">
Ext.onReady(function(){
Ext.QuickTips.init();
    var cm = new Ext.grid.ColumnModel([
        {header:'编号',dataIndex:'id',width:35},
        {header:'名称',dataIndex:'name',width:50},
        {id:'descn',header:'描述',dataIndex:'descn',width:200,renderer:function(value){
			return "<div ext:qtip='<img src=\""+value+"\" width=100 hight=100/>'>"+value+"</div>";
		}}
    ]);

    var data = [
        ['1','name1','14-01.png'],
        ['2','name2','14-01.png'],
        ['3','name3','14-01.png'],
        ['4','name4','14-01.png'],
        ['5','name5','14-01.png']
    ];

    var store = new Ext.data.Store({
        proxy: new Ext.data.MemoryProxy(data),
        reader: new Ext.data.ArrayReader({}, [
            {name: 'id'},
            {name: 'name'},
            {name: 'descn'}
        ])
    });
    store.load();

    var grid = new Ext.grid.GridPanel({
        autoHeight: true,
        renderTo: 'grid',
        store: store,
        cm: cm
    });

});
        </script>
    </head>
    <body>
        <div id="grid"></div>
    </body>
</html>

 

 

 ext grid 单元格提示 出现图片

你可能感兴趣的:(JavaScript,html,css,ext)