方法一:{field:‘pictureId‘,title:‘是否有海报‘,width:70,align:"center",
// v 当前字段值, r行对象, i为索引
formatter:function(v,r,i){
if(r.pictureId == null || r.pictureId == ‘‘){
$(‘#gridspecialprogram‘).datagrid(‘hideColumn‘, ‘pictureId‘);//pictureId:filed值
}else{
$(‘#gridspecialprogram‘).datagrid(‘showColumn‘, ‘pictureId‘);//gridspecialprogram:datagrid的id
return r.pictureId;
}
}
}
方法二:{field:‘pictureId‘,title:‘是否有海报‘,width:70,align:"center",
// v 当前字段值, r行对象, i为索引
formatter:function(v,r,i){
if(r.pictureId == null || r.pictureId == ‘‘){
$(‘td[field="pictureId"]‘).hide();//pictureId:filed值
}else{
$(‘td[field="pictureId"]‘).show();//gridspecialprogram:datagrid的id
return r.pictureId;
}
}
}
---------------------
作者:成市风彩
来源:CSDN
原文:https://blog.csdn.net/world_the_begin/article/details/80326805