$("#gridTable").jqGrid({
    //...其它属性
    colModel: [
            //...其它列
            { name: 'dsource_alarm', index: 'dsource_alarm', width: 30, align: "center", sortable: false, editable: false, formatter: alarmFormatter }
            
    ]
});
    
//自定义报警列格式
function alarmFormatter(cellvalue, options, rowdata)
{
    if (cellvalue != "0")
        return '<img class="alarmimg" src="../Images/128x128/RedLight.png" alt="' + cellvalue + '" />';
    else 
        return '<img class="alarmimg" src="../Images/128x128/GreenLight.png" alt="' + cellvalue + '" />';
}

 

 

来源:https://www.cnblogs.com/james641/p/5945486.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
猜你喜欢
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案