当鼠标移动到电子表格上单击选中行时,该行高亮显示。
类型 | 对象 | 事件 |
ClientSide | SpreadsheetReport | onRender |
function main(spreadsheetReport, isAjaxRefreshCallback) { spreadsheetReport._focusTR = null; spreadsheetReport.initTableGrid(); spreadsheetReport.addListener(spreadsheetReport.elemSheetFrame.contentWindow.document.body, "click", function(e) { var t = e.target; while (t && t.tagName != "TR") t = t.parentNode; if (!t) return; if (this._focusTR) { var tdRow = this.tableGrid[this._focusTR.rowIndex]; for (var i = 0; i < tdRow.length; i++) { tdRow[i].style.backgroundColor = tdRow[i]._originalBackgroundColor; } } this._focusTR = t; var tdRow = this.tableGrid[t.rowIndex]; for (var i = 0; i < tdRow.length; i++) { var td = tdRow[i]; if (typeof td._originalBackgroundColor == "undefined") { td._originalBackgroundColor = td.style.backgroundColor; } td.style.backgroundColor = "#abe5fe"; } }, spreadsheetReport, "sheetFrameBody"); } |
示例宏资源:选中行高亮.xml