|
楼主 |
发表于 2016-5-12 17:31:40
|
显示全部楼层
本帖最后由 wangjb 于 2016-5-12 18:19 编辑
我查看了一下,我是对“新建”操作做了修改,原来的新建操作的动作调用的是 {operation:'docNodeTree.newChild'} ,
由于这种操作不能满足我的需求,所以我将新建操作做了修改,改成方法 button4Click,代码如下:
// 景建波 新建目录
Model.prototype.button4Click = function(event) {
var docNodeTree = this.comp("docNodeTree");
var docID = (new justep.UUID()).valueOf();
var parentID = docNodeTree.getCurrentRowID();
var options = {
defaultValues : [ {
"SA_DocNode" : docID,
"sParentID" : parentID
} ]
};
docNodeTree.newData(options);
this.docNodeTreeIndexChanged();
this.docNodeListIndexChanged();
};
说明:newChild 是BIZDATA 的操作 Operations ,我想直接调用,可是docNodeTree 不能访问,于是我使用了 newData 方法,所以出现了上面的问题。
我问一下,如何JS 调用BIZDATA 的操作 Operations 中提供的方法,比如 newChild
还有一个问题:
文档中心的 保存 按钮的操作 {'operation':'docNodeTree.save'} docNodeTree 的删除 操作deleteBtnClick , docNodeTree 的 删除之后事件去掉
// 景建波 添加 删除目录
Model.prototype.deleteBtnClick = function(event) {
this.deleteDocOrDir('docNodeTree');
};
// 景建波 添加 删除目录或者文档
Model.prototype.deleteDocOrDir = function(data) {
if (confirm('是否删除数据?')) {
var docNodeList = this.comp(data);
var fileID = docNodeList.getValue("sFileID");
var docPath = docNodeList.getValue("sDocPath");
var version = docNodeList.getValue("version");
var docVersionID = docNodeList.getValue("sDocLiveVersionID");
var docName = docNodeList.getValue("sDocName");
var kind = docNodeList.getValue("sKind");
var size = docNodeList.getValue("sSize");
var parent_id = docNodeList.getValue("sParentID");
var sDocDisplayPath = docNodeList.getValue("sDocDisplayPath");
var sDescription = docNodeList.getValue("sDescription");
var sClassification = docNodeList.getValue("sClassification");
var sKeywords = docNodeList.getValue("sKeywords");
var sFinishTime = docNodeList.getValue("sFinishTime");
var sDocSerialNumber = docNodeList.getValue("sDocSerialNumber");
// 景建波 判断是否被别人锁住
var cacheInfo = DocUtils.InnerUtils.queryDocCache(docNodeList.getCurrentRowID());
if (cacheInfo.isLockSuccess == "failure") {
alert("该文件正在被别人编辑,您不能删除,只能浏览最新版本");
return;
}
var changeLog = {
items : [],
autoCreateVersion : true,
"operate" : "",
"url" : ""
};
DocUtils.InnerUtils.addChangeLog(changeLog, "delete", [ docNodeList.getCurrentRowID(), version, fileID, docVersionID, docName, kind, size, parent_id, docPath, sDocDisplayPath,
sDescription, sClassification, sKeywords, sFinishTime, sDocSerialNumber ], undefined, undefined, this.getContext());
DocUtils.InnerUtils.deleteDocAction(changeLog, null, this.getContext());
var jjb=docNodeList.getCurrentRow();
var confirmDelete = docNodeList.confirmDelete;
var directDeleteMode = docNodeList.directDeleteMode;
try {
docNodeList.confirmDelete = false;
docNodeList.deleteData(docNodeList.getCurrentRow());
docNodeList.deleteDatas.pop(jjb);
} finally {
docNodeList.confirmDelete = confirmDelete;
}
docNodeList.remove(jjb);
}
};
当点击删除按钮时,代码执行到 docNodeList.deleteData(docNodeList.getCurrentRow()); 时, 保存按钮高亮(由于代码执行到这,后台已经将该目录从数据库中删除,所以不需要高亮,不需要再保存),此时发现docNodeList.deleteDatas 里出现一条记录 (我以为是因为这条记录导致保存按钮高亮), 于是执行了 docNodeList.deleteDatas.pop(jjb); 将删除的记录清除,此时docNodeList.deleteDatas 里的记录为零,结果发发现 保存按钮依然是高亮的
请问:保存按钮 高亮能操作 是由什么引起的?如何改变这个操作?
|
|