formatter | mixed | 对列进行格式化时设置的函数名或者类型 {name:’sex’,index:’sex’, align:’center’,width:60,editable:true,edittype:’select’,editoptions: {value:’0:待定;1:男;2:女’},formatter:function(cellvalue, options, rowObject){
var temp = “<img src=’/jqGrid/jquery-ui-1.7.2.custom/css/img/” if(cellvalue==1){ temp = temp +”user-white.png”; } else if(cellvalue==2){ temp = temp +”user-white-female.png”; } else { temp = temp + “user-silhouette.png”; } temp = temp + “‘ border=’0 ′ />” return temp; }},// 返回性别的图标。 |
colModel : [
{
name : 'cname',
index : 'cname',
width : '15%',
align : 'center',
formatter:function(cellvalue, options, rowObject){
return rowObject['cname'].replace("停车场","路段");
}
},
{
name : 'ordercount',
index : 'ordercount',
width : '15%',
align : 'center',
formatter:function(cellvalue, options, rowObject){
return '98.12%';
},hidden:true
},
]