(本文档仅供参考)

问题1:

PC端想要隐藏电子表格的滚动条:

解决方案:

可以参考下方宏实现:

function main(spreadsheetReport, isAjaxRefreshCallback) {
debugger
var sc = spreadsheetReport.elemSheetFrame.contentDocument.styleSheets[0];
insertRule(sc, "::-webkit-scrollbar", "display: none;", 0);
}

function insertRule(sheet, selectorText, cssText, position) {
if (sheet.insertRule) {
sheet.insertRule(selectorText + "{" + cssText + "}", position);
} else if (sheet.addRule) { //仅对IE有效
sheet.addRule(selectorText, cssText, position);
}
}


问题2:

移动端想要隐藏电子表格的滚动条:




function main(spreadsheetReport, isAjaxRefreshCallback) {
debugger
var scx = spreadsheetReport.elemSheetFrame.contentDocument.styleSheets[0];
insertRule(scx, ".ps-scrollbar-x-rail", "display: none !important;", 0);
insertRule(scx, ".ps-scrollbar-y-rail", "display: none !important;", 0);
}

function insertRule(sheet, selectorText, cssText, position) {
if (sheet.insertRule) {
sheet.insertRule(selectorText + "{" + cssText + "}", position);
} else if (sheet.addRule) { //仅对IE有效
sheet.addRule(selectorText, cssText, position);
}
}