示例说明
在灵活分析报表中,如何实现分页信息(翻页按钮、上页下页按钮)放到表格的下方显示"?可以参考本文设置方法。
设置方法
- 在资源定制中,创建一张灵活分析;
- 选中灵活分析,右键选择 编辑宏 进入报表宏界面。
- 在报表宏界面新建客户端模块,在弹出的新建模块对话框中选择对象为 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);