|
现在的OA中带了好多的js,在用最新的x5开发后是否还是需写js函数
下面的是发文中往来单位的js
function trgSearchDOMActivate(event) {
justep.xbl('wdlgOrgSelect').open();
}
function wdlgOrgSelectSend(event) {
var data = {
"rootFilter" : "sParent is null",
"fixedFilter" : "1=1",
"manageTypeCodes" : "",
"displayableOrgKinds" : "ogn,dpt",
"selectableOrgKinds" : "ogn,dpt"
// "onlyMainPsm" : true
};
return data;
}
function wdlgOrgSelectReceive(event) {
//debugger;
var dExternalUnit = justep.xbl('dExternalUnit');
var rowID = event.data.getRowId(0);
var orgID = rowID;
var code = event.data.getValueByName("sCode", 0);
var orgName = event.data.getValueByName("sName", 0);
/*var orgURL = event.data.getValueByName("sFID", 0);
var orgURLName = event.data.getValueByName("sFName", 0);*/
dExternalUnit.setValue("fCode", code);
dExternalUnit.setValue("fOrgID", orgID);
dExternalUnit.setValue("fName", orgName);
/*dExternalUnit.setValue("fOrgURL", orgURL);
dExternalUnit.setValue("fOrgURLName", orgURLName);*/
}
function canSearch() {
// debugger;
var dExternalUnit = justep.xbl('dExternalUnit');
var currentRowId = dExternalUnit.getCurrentRowId();
if (!currentRowId || (currentRowId == '') || (currentRowId == '_is_root_')) {
return '0';
} else {
return '1';
}
}
/* 新增 */
function trgAddDOMActivate(event) {
var dExternalUnit = justep.xbl('dExternalUnit');
if (typeof(dExternalUnit) == "string")
dExternalUnit = justep.xbl(data);
if (!dExternalUnit)
return;
var fName = dExternalUnit.getValue("fName");
if (fName == "") {
alert("父节点名称不能为空!");
return;
}
var parentID = dExternalUnit.getRowId();
if(!parentID)
parentID = "";
var parentName = fName;
var parentURL = dExternalUnit.getValue("fOrgURL");
var parentURLName = dExternalUnit.getValue("fOrgURLName");
dExternalUnit.newData(null, parentID);
var url = parentURL + "/" + dExternalUnit.getCurrentRowId();
var urlName = parentURLName + "/" + dExternalUnit.getValue("fName");
dExternalUnit.setValue("fParent", parentID);
dExternalUnit.setValue("fParentName", parentName);
dExternalUnit.setValue("fOrgURL", url);
dExternalUnit.setValue("fOrgURLName", urlName);
}
function iptNameXformsValueChanged(event) {
var data = justep.xbl('dExternalUnit');
var urlName = data.getValue("fOrgURLName");
var names = urlName.split("/");
names[names.length - 1] = data.getValue("fName");
data.setValue("fOrgURLName", names.join("/"));
}
function grdExternalUnitShowNodeImg(event){
var data = justep.xbl(event.instance.element.id);
if (!data)
return;
if (event.rowId == 'externalUnit') {
return "/UI/OA/common/images/org_root.gif";
} else {
return "/UI/OA/common/images/org.gif";
}
}
|
|