前端grid表格每行数据设置不同颜色
grid表格基本参数:
initOutputGrid: function () {
var self = this;
self.optOutParam = {paramMap: {}};
if (this.options.opt) {
self.optOutParam.paramMap.apiId = self.options.opt.apiId;
self.optOutParam.paramMap.type = 'API-OUT';
self.optOutParam = fish.extend(self.optOutParam, {callBack: this.callBack});
self.optOutParam.url = '/OSS-SO-BUSI/NsoBiCpcpProductApiParamsController/qry4grid.qry';
var state = this.options.opt.apiState;
var gridOptions = {
height: 300,
colModel: [
{name: 'id', label: '标识', hidden: true, key: true},
{name: 'apiId', label: 'apiId', hidden: true,},
{
name: 'code', label: '参数编码', sortable: false, width: 45,
formatter: function (cellValue, options, rowObject) {
var color = self.convertNum(cellValue, 6, 16);
return "<button style='color:#" + color + "' type=\"button\" data-id='" + cellValue
+ "' class=\"btn btn-link \">" + cellValue + "</button>";
}
},
{name: 'name', label: '