1、formatter使用
formatter這個屬性屬於列參數,意思就是對當前列的數據進行格式化操作,
有三個參數,value,row,index
value:代表當前單元格中的值,
row:代表當前行,
index:代表當前行的下標
//示例 列表字段增加超鏈接
formatter: function (value, row, index) { return "<span style='cursor: pointer;color:#00a4ff' onclick=student.view('"+row.id+"\')>" +value + "</span>"; }
student.view = function () {
//超鏈接詳情
}