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

提示:本文档的示例代码仅适用于本文档中的示例报表/场景。若实际报表/场景与示例代码无法完全适配(如使用功能不一致,或多个宏代码冲突等),需根据实际需求开发代码。

示例说明

在灵活分析报表中,如何实现分页信息(翻页按钮、上页下页按钮)放到表格的下方显示"?可以参考本文设置方法。


设置方法

  1. 在资源定制中,创建一张灵活分析;
  2. 选中灵活分析,右键选择 编辑宏 进入报表宏界面。
  3. 在报表宏界面新建客户端模块,在弹出的新建模块对话框中选择对象为 simpleReport;事件为 onRender;并把下面宏代码复制到代码区域。


宏类型

类型

对象

事件

ClientSide

simpleReport

onRender


宏代码

function main(simpleReport, simpleReportContext) {
    //debugger;
    //获取分页栏目
    var navigationElem = simpleReport.navigationLay;
    var parentElem = navigationElem.parentNode;
    // 先将分页栏目从父节点中移除,再插入到"图形节点"之前
    parentElem.removeChild(navigationElem);
    parentElem.insertBefore(navigationElem, simpleReport.graphLay);
    //分页栏右对齐
    //navigationElem.firstChild.firstChild.firstChild.firstChild.firstChild.firstChild.align = "right";
    if (navigationElem.firstChild && navigationElem.firstChild.firstChild && navigationElem.firstChild.firstChild.firstChild && navigationElem.firstChild.firstChild.firstChild.firstChild && navigationElem.firstChild.firstChild.firstChild.firstChild.firstChild && navigationElem.firstChild.firstChild.firstChild.firstChild.firstChild.firstChild) {
        navigationElem.firstChild.firstChild.firstChild.firstChild.firstChild.firstChild.align = "right";
    }
}


关键对象总结

  • 获取分页栏目:simpleReport.navigationPanel.parentNode.parentNode;
  • 将分页栏目从其父节点中移除:parentElem.removeChild(navigationElem);
  • 将分页栏目插入到Graph节点之前:parentElem.insertBefore(navigationElem, graphElem);


资源下载:migrate调整顺序:分页信息放到报表下方.xml

  • 无标签