<style type="text/css">
.high_line{
color: red;
}
</style>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
searchForm: $("#searchForm"),
columnModel: [
{header:'id', name:'id', index:'a.id', hidden:true},
{header:'${text("设备名称")}', name:'sbmc', index:'a.sbmc', width:150, align:"center", frozen:true},
{header:'${text("设备编号")}', name:'sbbh', index:'a.sbbh', width:100, align:"center"},
{header:'${text("终端编号")}', name:'zdbh', index:'a.zdbh', width:100, align:"center"},
//{header:'${text("RFID")}', name:'rfid', index:'a.rfid', width:150, align:"center"},
{header:'${text("告警类型")}', name:'gljx', index:'a.gljx', width:100, align:"center"},
{header:'${text("告警内容")}', name:'gjnr', index:'a.gjnr', width:250, align:"left"},
{header:'${text("确认状态")}', name:'qrzt', index:'a.qrzt', width:80, align:"center", formatter:function(val, obj, row, act){
if(val == "未确认"){
val = "<span style='color:red;font-weight: bold;background: yellow;padding: 3px;'>"+val+"</span>";
}
return val;
}},
{header:'${text("告警时间")}', name:'gjsj', index:'a.gjsj', width:100, align:"center"},
{header:'${text("确认时间")}', name:'qrsj', index:'a.qrsj', width:100, align:"center"}
],
// hoverrows: false,
// 加载成功后执行事件
ajaxSuccess: function(data){
var rows = $('#dataGrid').dataGrid('getRowData');
for(var value of rows){
if(value.qrzt == "未确认"){
//val = "<span style='color:red;font-weight: bold;background: yellow;padding: 3px;'>"+val+"</span>";
$("#"+value.id).addClass("high_line");
}else{
$("#"+value.id).removeClass("high_line");
}
}
}
});
Jeesite--- Datagrid 行高亮+单元格高亮
最新推荐文章于 2024-03-15 10:50:29 发布