• 2012/7/26给Extjs grid中的列自定义渲染方式


    给grid中其中网址的那一列,加上超链接,使之点击即可进入。

    看代码:

    function showUrl(value)
    {
    	return "<a href="+value+">"+value+"</a>";
    }
    Ext.onReady(function(){	
    	var data=[
    		{id:1,name:'EasyJWeb',organization:'EasyJf',homepage:'www.Easyjf.com'},
    		{id:2,name:'jfox',organization:'huihoo',homepage:'www.huihoo.com'},
    		{id:3,name:'jdon',organization:'jdo',homepage:'www.jdon.com'},
    		{id:4,name:'springside',organization:'springside',homepage:'www.springside.com'}
    		];
    	var store = new Ext.data.JsonStore(
    		{
    			data:data,
    			fields:['id','name','organization','homepage']
    		}	
    	);
    	var colM = new Ext.grid.ColumnModel(
    		[
    			{header:'项目名称',dataIndex:'name',sortable:true},
    			{header:'开发团队',datIndex:'organization',sortable:true},
    			{header:'网址',dataIndex:'homepage',renderer:showUrl}
    			]	
    	);
    	var grid = new Ext.grid.GridPanel({
    		renderTo:'hello',
    		title:'中国java开源产品及团队',
    		height:200,
    		600,
    		cm:colM,
    		store:store,
    		autoExpandColumn:2
    	});
    	
    	});
    

  • 相关阅读:
    开发趋势
    常用的meta
    meta基础
    HTTP请求方法GET和POST
    same-origin policy----wikipedia
    跨域——同源策略(译)
    DNS问答
    TCP/IP的整理
    鉴权方法
    Web攻击技术---OWASP top
  • 原文地址:https://www.cnblogs.com/howlaa/p/2610118.html
Copyright © 2020-2023  润新知