在网上找了很久的例子,无果!最后捣鼓出来了,其实很简单,但是浪费了很多时间,贴在此处供有需之人用!以免费时费力。。
这是效果图。
上面便是代码,关键是最后一相:
{
header: "项目进度%",
width: 80,
sortable: true,
dataIndex: 'progress',
//renderer: getColor
renderer: function(value){
var width = parseInt(value);
return '<font color=blue></font><span style="background-color:#7A96DF;display:block;width:'+width+'%;">' + value + '</span>';
}
}