EXTjs grid 超链接

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


注意这里的showUrl函数!


你可能感兴趣的:(Extjs)