BootstrapTable formatter使用

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 () {
  //超链接详情

}

 

posted @ 2021-08-05 17:26  唏嘘-  阅读(1622)  评论(0编辑  收藏  举报