-
-
伴生 初学数据Lv2
发表于2022-7-6 17:26
悬赏20
已解决

插入行后脚本:var report = g_formmgr.rpts.GRID1;
var grid = report.gridbase;
var count = grid.getProperty("heights").length;
var srcCells = grid.getInsertCell("A2");
for(var i = 1;i < count;i ++){
var tempCell = grid.getCell(i,0);
tempCell.setDisplayText(i);
grid.renderCell(tempCell);
}
删除行后脚本:
var report = g_formmgr.rpts.GRID1;
var grid = report.gridbase;
var count = grid.getProperty("heights").length;
var srcCells = grid.getInsertCell("A2");
for(var i = 1;i < count;i ++){
var tempCell = grid.getCell(i,0);
tempCell.setDisplayText(i);
grid.renderCell(tempCell);
}


4个回答
可参考
ABI回填表格实现新增行序号自增效果--- https://bbs.esensoft.com/thread-141556-1-1.html
两包辣条约吗 发表于 2022-7-6 17:37
可参考
ABI回填表格实现新增行序号自增效果--- https://bbs.esensoft.com/thread-141556-1-1.html ...
还是有问题

两包辣条约吗 发表于 2022-7-6 17:37
可参考
ABI回填表格实现新增行序号自增效果--- https://bbs.esensoft.com/thread-141556-1-1.html ...
#号也不行

我这边使用#是好的哈,您试试下面脚本
插入行后脚本:var report = g_formmgr.rpts.GRID1;
var grid = report.gridbase;
var count = grid.getProperty("heights").length;
var srcCells = grid.getInsertCell("A2");
for(var i = 1;i < count;i ++){
var tempCell = grid.getCell(i,0);
tempCell.setDisplayText(i);
grid.renderCell(tempCell);
}
删除行后脚本:
var report = g_formmgr.rpts.GRID1;
var grid = report.gridbase;
var count = grid.getProperty("heights").length;
var srcCells = grid.getInsertCell("A2");
for(var i = 1;i < count;i ++){
var tempCell = grid.getCell(i,0);
tempCell.setDisplayText(i);
grid.renderCell(tempCell);
}