历史版本9 :页面交互接口 返回文档
编辑时间: 内容长度:图片数:目录数: 修改原因:

目录:

1. 插入删除行编辑

功能
接口参数说明示例支持移动端
插入行_g().appendReportRC(num,cell)

num:插入的行数

cell:插入位置的单元格编号。如果无此参数,则插入位置为鼠标焦点所在行

contentPane.appendReportRC(1,"A1")
_g().appendReportRow(this.options.location, this.options.reportIndex,num)

num:插入的行数

注:默认在当前行插入

_g().appendReportRow(this.options.location, this.options.reportIndex,1)
删除行_g().deleteReportRC(id)cell:删除位置的单元格编号。如果无此参数,则删除位置为鼠标焦点所在行_g().deleteReportRC("A1")
_g().deleteRows([id])cell:删除位置的单元格编号数组,支持批量删除行

_g().deleteRows(['A1','A2'])

2. 刷新页面编辑

功能接口参数说明示例支持移动端
重加载整个页面location.reload()location.reload()

重新查询(需要有参数面板)

_g().parameterCommit()_g().parameterCommit()

重新查询(刷新所有sheet)

_g().refreshAllSheets()_g().refreshAllSheets()

重新查询(刷新当前sheet)

_g().reloadCurLGPPane()_g().reloadCurLGPPane()

3. 其他编辑

功能接口参数说明示例
支持移动端
判断页面是否被编辑过_g().isDirtyPage()_g().isDirtyPage()
判断是否开启自动暂存_g().isAutoStash()_g().isAutoStash()
切换指定sheet_g().loadSheetByIndex(sheet)sheet:sheet序号( 从0开始 )或者sheet名

_g().loadSheetByIndex(0)

_g().loadSheetByIndex("sheet1")

打开对话框FR.showDialog(title, width, height, inner)

title:对话框标题

width:对话框宽度

height:对话框高度

inner:对话框内容

FR.showDialog("Test",600,400,"Hello World")
监听单元格选择动作_g().on("cellselect", function(td){})td:单元格对象,默认参数不需要修改
_g().on("cellselect", function(td) {
alert(_g().curLGP.getTDRow(td));
//选择单元格时弹出行号
})

4.注意事项编辑

1)如果用FR.showDialog()打开的对话框希望展示具体的模板或者网页,则可以使用iframe的方式。示例如下。

var iframe = $("<iframe id='iframe0' width='100%' height='100%' scrolling='yes' framedorder='0'>");
// 创建对话框内的 iframe,默认宽高占比100%,可向下滚动,无边框
iframe.attr("src", "/webroot/decision/view/report?viewlet=GettingStarted.cpt");
// 给 iframe 添加 src 属性,指向需要展示的模板地址
var o = {
width: 700, //对话框宽度  
height: 500 //对话框高度
};
FR.showDialog("对话框", o.width, o.height, iframe, o);
//弹出对话框