孙杰 发表于 2021-8-20 11:03
var mylist = Forguncy.Page.getListView("表格1");
mylist._grid.listviewData.metadata.CanAddRow = t ...
禁用表格编辑删除 JAVASCRIPT 命令
var mylist = Forguncy.Page.getListView("表格1");
mylist._grid.listviewData.metadata.CanAddRow = false;
mylist._grid.listviewData.metadata.CanEdit = false;
mylist._grid.listviewData.metadata.CanDelete = false;
//定义事件处理函数
var select = function(arg1,arg2) {
var adom = document.getElementsByClassName('deleteButton');
for(var i = 0;i<adom.length;i++){
adom.style.visibility = "hidden";
};
}
//获取当前页面
var page = Forguncy.Page;
//获取表格对象
var listview = page.getListView("表格1");
//绑定表格的事件
listview.bind("selectionChanged", select);
2 启用表格编辑删除命令
var mylist = Forguncy.Page.getListView("表格1");
mylist._grid.listviewData.metadata.CanAddRow = true;
mylist._grid.listviewData.metadata.CanEdit = true;
mylist._grid.listviewData.metadata.CanDelete = true;
//定义事件处理函数
var select = function(arg1,arg2) {
var adom = document.getElementsByClassName('deleteButton');
for(var i = 0;i<adom.length;i++){
adom.style.visibility = "visible";
};
}
//获取当前页面
var page = Forguncy.Page;
//获取表格对象
var listview = page.getListView("表格1");
//绑定表格的事件
listview.bind("selectionChanged", select);
以上两个命令都是在表格绑定“selectionChanged” 事件中进行启用,禁用的。
|