在透视分析添加排序的告警效果。
类型 | 对象 | 事件 |
ClientSide | INSIGHT | onRenderTable |
function main(insight) { var starIndex = 1; //数据开始行,行号从0开始,如果有多重表头则要修改到数据行开始 var cellIndex = 0; //显示图片信息的列序号,序号从0开始。 settingTips(insight, starIndex, cellIndex); } function settingTips(insight, starIndex, cellIndex) { var grid = insight.grid; var maxRow = grid.getRowSize(); //总行数 for (var m = starIndex; m < maxRow; m++) { var cell = grid.getDataCell(m, cellIndex); //获取列 cell.align = "center"; var value = cell.innerText; if (value == 1) { //根据值不同,显示不同的图片 cell.innerHTML = '<img src="./img/mapflag/square-star.png" />'; } else if (value == 2) { cell.innerHTML = '<img src="./img/mapflag/star.png" />'; } else if (value == 3) { cell.innerHTML = '<img src="./img/mapflag/triangle.png" />'; } else { //cell.background = "img/alertdialog/Icon_4.gif"; cell.style.background = 'url(img/mapflag/none.png) no-repeat center center'; cell.style.fontWeight = 'bold'; cell.style.fontSize = '16'; cell.style.height = '30'; cell.style.backgroundColor = ''; } } } |
资源: migrate.xml