ext grid 单元格提示 出现图片

代码简单 只是记录一下

 

Js代码 复制代码
  1.   <html>   
  2.     <head>   
  3.         <meta http-equiv="Content-Type" content="text/html; charset=gbk">   
  4.         <title>03.grid</title>   
  5.         <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />   
  6.         <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>   
  7.         <script type="text/javascript" src="../../ext-all.js"></script>   
  8.         <script type="text/javascript">   
  9. Ext.onReady(function(){   
  10. Ext.QuickTips.init();   
  11.     var cm = new Ext.grid.ColumnModel([   
  12.         {header:'编号',dataIndex:'id',width:35},   
  13.         {header:'名称',dataIndex:'name',width:50},   
  14.         {id:'descn',header:'描述',dataIndex:'descn',width:200,renderer:function(value){   
  15.             return "<div ext:qtip='<img src=/""+value+"/" width=100 hight=100/>'>"+value+"</div>";   
  16.         }}   
  17.     ]);   
  18.   
  19.     var data = [   
  20.         ['1','name1','14-01.png'],   
  21.         ['2','name2','14-01.png'],   
  22.         ['3','name3','14-01.png'],   
  23.         ['4','name4','14-01.png'],   
  24.         ['5','name5','14-01.png']   
  25.     ];   
  26.   
  27.     var store = new Ext.data.Store({   
  28.         proxy: new Ext.data.MemoryProxy(data),   
  29.         reader: new Ext.data.ArrayReader({}, [   
  30.             {name: 'id'},   
  31.             {name: 'name'},   
  32.             {name: 'descn'}   
  33.         ])   
  34.     });   
  35.     store.load();   
  36.   
  37.     var grid = new Ext.grid.GridPanel({   
  38.         autoHeight: true,   
  39.         renderTo: 'grid',   
  40.         store: store,   
  41.         cm: cm   
  42.     });   
  43.   
  44. });   
  45.         </script>   
  46.     </head>   
  47.     <body>   
  48.         <div id="grid"></div>   
  49.     </body>   
  50. </html>  
  <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>

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值