为光滑网格编写自定义格式化程序 [英] Writing custom formatters for slick grid

查看:95
本文介绍了为光滑网格编写自定义格式化程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写自定义单元格格式器时

While writing custom cell formatters

 function PercentCompleteFormatter(row, cell, value, columnDef, dataContext)

这是我们必须遵循的基本定义。我在光滑网格中得到关于dataContext参数的解释。它实际上代表什么。

This is the basic definition we have to follow.can i get explanation about dataContext argument in slick grid.What it actually represents.

确切的代码是

function PercentCompleteFormatter(row, cell, value, columnDef, dataContext) {
if (value == null || value === "") {
  return "-";
} else if (value < 50) {
  return "<span style='color:red;font-weight:bold;'>" + value + "%</span>";
} else {
  return "<span style='color:green'>" + value + "%</span>";
}
}

我只想要上面代码中的dataContext代表

I just want what dataContext in above code represents

推荐答案

dataContext是正在渲染的行的单元格绑定的数据项。

"dataContext" is the data item that the cell for the row being rendered is bound to.

这篇关于为光滑网格编写自定义格式化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆