//动态 css文件内容。 修改鼠标经过时行、单元格的背景颜色 function header_rowOrcell_over(divGrid) { var gridopts = divGrid.data("PartConfig"); var customStyle = gridopts.customStyle; var easyuiCss= $("body").data("easyuiCss"); var overCss = $("body").data("overCss"); //获取光标的样式 var selectedCss = $("body").data("selectedCss"); //选中行的样式 if (!easyuiCss) { //之前没有保存 easyui.css 相关的内容,则获取 var styleSheetArr = document.styleSheets; var styleSheet = null; for (var i = 0; i < styleSheetArr.length; i++) { if (styleSheetArr[i].href.indexOf("/cwbase/bi/binewweb/Styles/themes/metro/easyui.css") > -1) { //获取 保存 easyui.css 文件内容的对象。 styleSheet = styleSheetArr[i]; break; } } easyuiCss = styleSheet.cssRules; $("body").data("easyuiCss", easyuiCss); } if (!overCss || !selectedCss) { //之前没有保存,则获取 for (var i = 0; i < easyuiCss.length; i++) { if (easyuiCss[i].selectorText.indexOf(".datagrid-header td.datagrid-header-over") > -1) { overCss = easyuiCss[i]; $("body").data("overCss", overCss); if ($("body").data("selectedCss")) { //selectedCss 也已经获取 break; } } if (easyuiCss[i].selectorText.indexOf(".datagrid-row-selected") > -1) { selectedCss = easyuiCss[i]; $("body").data("selectedCss", selectedCss); if ($("body").data("overCss")) { //overCss 也已经获取 break; } } } } if (customStyle.headerBackColorOver) { overCss.style.backgroundColor = customStyle.headerBackColorOver; } if (customStyle.rowSelectBackColor) { selectedCss.style.backgroundColor = customStyle.rowSelectBackColor; } }
//动态 css文件内容。 修改鼠标经过时行、单元格的背景颜色function header_rowOrcell_over(divGrid) { var gridopts = divGrid.data("PartConfig"); var customStyle = gridopts.customStyle; var easyuiCss= $("body").data("easyuiCss"); var overCss = $("body").data("overCss"); //获取光标的样式 var selectedCss = $("body").data("selectedCss"); //选中行的样式 if (!easyuiCss) { //之前没有保存 easyui.css 相关的内容,则获取 var styleSheetArr = document.styleSheets; var styleSheet = null; for (var i = 0; i < styleSheetArr.length; i++) { if (styleSheetArr[i].href.indexOf("/cwbase/bi/binewweb/Styles/themes/metro/easyui.css") > -1) { //获取 保存 easyui.css 文件内容的对象。 styleSheet = styleSheetArr[i]; break; } }
easyuiCss = styleSheet.cssRules; $("body").data("easyuiCss", easyuiCss); } if (!overCss || !selectedCss) { //之前没有保存,则获取 for (var i = 0; i < easyuiCss.length; i++) { if (easyuiCss[i].selectorText.indexOf(".datagrid-header td.datagrid-header-over") > -1) { overCss = easyuiCss[i]; $("body").data("overCss", overCss); if ($("body").data("selectedCss")) { //selectedCss 也已经获取 break; } } if (easyuiCss[i].selectorText.indexOf(".datagrid-row-selected") > -1) { selectedCss = easyuiCss[i]; $("body").data("selectedCss", selectedCss); if ($("body").data("overCss")) { //overCss 也已经获取 break; } } } } if (customStyle.headerBackColorOver) { overCss.style.backgroundColor = customStyle.headerBackColorOver; } if (customStyle.rowSelectBackColor) { selectedCss.style.backgroundColor = customStyle.rowSelectBackColor; } }