页面树结构
转至元数据结尾
转至元数据起始

(本文档仅供参考,若与实际场景不符,需结合实际自行调整)

问题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);
}
}

问题3:

隐藏照相机电子表格的滚动条:

function main(spreadsheetReport, isAjaxRefreshCallback) {
debugger
var domutils = jsloader.resolve("freequery.lang.domutils");
if (domutils.isIOS() && spreadsheetReport.hasCamera) {
spreadsheetReport.initCamera(spreadsheetReport.elemSheetFrame.contentWindow);
}
var iframe = spreadsheetReport.shapesMap["Picture 2"];
if (!iframe) {
return;
}
jQuery(iframe).on("load", function() {
var scx = iframe.contentDocument.styleSheets[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);
}
}


  • 无标签