示例代码:需要使用到rowStyler标签,如下
<t:datagrid name="waitExamineCommentList" rowStyler="rowStyleSum" title="待审核评论列表" checkbox="true" fitColumns="false" actionUrl="commentController.do?waitExamineCommentListGrid" pagination="true" idField="id" fit="true" pageSize="20" queryMode="group">
<t:dgCol title="非法校验结果" field="illegalcheckresult" query="false" width="350"></t:dgCol>
<t:dgCol title="轮播图标题" field="doctitle" showLen="20" url = "{wl}" query="true" width="500" funname="detailsSee"></t:dgCol>
</t:datagrid>
// 添加背景
function rowStyleSum(index,row){
if(row.illegalcheckresult!="评论内容:通过;评论图片:为空"){
row.illegalcheckresult="<span style='color:red;'>"+row.illegalcheckresult+"</span>";
// 以下为蓝色并添加下划线
row.doctitle="<span style='flood-color: blue;text-decoration: underline;color: blue;cursor:pointer'>"+row.doctitle+"</span>";
}
}
//html页面打开
function detailsSee(title,url){
window.open(url)
}
最终结果:
// 以下为蓝色并添加下划线