JqGrid自定义(图片)列
$("#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 + '" />'; }
关于Asp.net MVC中JqGrid使用,参见另一片文章:http://www.cnblogs.com/zhangpengshou/archive/2013/04/17/3025936.html