|
发表于 2015-3-24 14:14:41
|
显示全部楼层
变换一种思路解决
将下列代码拷贝到这个文件:/UI/OA/knowledge/process/simpleKnowledgeBase/simpleKnowledgeBase.js
然后在
代码:
function treeExpand(id){
var grdFolder = xforms('grdFolder').grid;
var parent = id;
var subFolders = getDirectSubFolders(parent);
if ((subFolders != '') && (subFolders != null)) {
var arrFolder = subFolders.split("|");
var len = arrFolder.length;
if (len <= 0) {
return;
}
var nodeHead = "<rows parent=\"" + parent + "\">";
var nodeTail = "</rows>";
var rows = "";
for (var i = 0; i < len; i++) {
var folder = arrFolder;
var folderID = folder.split(":")[0];
var folderName = folder.split(":")[1];
var folderFullID = folder.split(":")[2];
grdFolder.addRowPro(folderID, [folderName, folderFullID], i,
parent);
}
}
// event.source.setNodeLoadSuccess(event.rowId);
};
function mdKnowledgexforms_model_construct_done(event) {
debugger;
var grdFolder = xforms('grdFolder').grid;
var rowid = grdFolder.selectRowID;
if(rowid != '' && rowid != null && rowid != undefined) {
grdFolder.expand(rowid);
treeExpand(rowid); //增加这句调用函数的代码
}
}
然后修改 |
|