<script type="text/javascript">
function showUrl(value)
{
return "<a href='http://"+value+"' target='_blank'>"+value+"</a>";
}
function abc(value){
return String.format('<a href="http://{0}">{0}</a>',value);
}
Ext.onReady(function(){
var data=[[1,'百度','www.baidu.com'],
[2,'谷歌','www.google.com'],
[3,'迅雷','www.xunlei.com'],
[4,'腾讯','www.qq.com']];
var store=new Ext.data.SimpleStore({data:data,fields:["id","name","homepage"]});
var colM = new Ext.grid.ColumnModel([{header:"中文名称",dataIndex:"name",sortable:true},
{header:"网址",dataIndex:"homepage",renderer:showUrl}
]);
var grid = new Ext.grid.GridPanel({
renderTo:"hello",
title:"中国开发团队",
height:150,
width:600,
/*
columns:[{header:"中文名称",dataIndex:"name",sortable:true},
{header:"网址",dataIndex:"homepage"}
],
*/
cm:colM,
store:store,
autoExpandColumn:2
});
});
</script>
renderer 超链接解决方案2
最新推荐文章于 2023-07-03 17:39:42 发布