感谢。看着你的链接才知道使用的是spreadjs的api,查了下spreadjs的官方文档,通过设置整个表页保护,可以控制整个表不能被编辑
var p = Forguncy.Page
var listview = p.getListView("表格1");
var activeSheet = listview.getControl().getActiveSheet();
var option = {
allowSelectLockedCells:true,
allowSelectUnlockedCells:true,
allowFilter: true,
allowSort: false,
allowResizeRows: true,
allowResizeColumns: false,
allowEditObjects: false,
allowDragInsertRows: false,
allowDragInsertColumns: false,
allowInsertRows: false,
allowInsertColumns: false,
allowDeleteRows: false,
allowDeleteColumns: false,
allowOutlineColumns: false,
allowOutlineRows: false
};
activeSheet .options.protectionOptions = option;
activeSheet .options.isProtected = true; |