function main(spreadsheetReport) {
debugger;
var list = spreadsheetReport.getExpandedPositions("B4"); //获取【删除】字样的所有单元格
for (var i = 0; i < list.length; i++) {
var pos = spreadsheetReport.parseCellIndex(list);
var td = spreadsheetReport.getCell(pos[0], pos[1]); //获取单元格
if (td){
td.style.cursor = "pointer"; //鼠标变手
td.toDeleteCell = pos[0];
td.onclick = function() {
var modalWindow = jsloader.resolve("freequery.common.modalWindow");
//if (!modalWindow.open("确认删除吗?", "警告", modalWindow.MB_YESNO | modalWindow.MB_ICONQUESTION) == modalWindow.ID_YES) {
var flag = confirm("确认删除吗?");
if (flag) {
debugger;
//实际上允许删除的单元格,在这个例子中是C4这个单元格,所以使用2作为列,从0 开始数,需要根据实际情况修改
spreadsheetReport.spreadsheetReportWriteBack.currentEditingPosition = this.toDeleteCell + ":2";
//调用删除
spreadsheetReport.spreadsheetReportWriteBack.doRemoveRowClick();
}
}
}
}
} |