?? fieldlookup.js
字號:
/*
作者:鐵維慶
此頁用于實現彈出窗口,并將表單名稱及表單字段名稱傳遞給彈出窗口
*/
// ================= FIELD LOOKUP METHODS ============================
//
//聲明兩個變量,用于存貯表單名稱或表單字段名稱
var target = null;
var target2 = null;
var target3 = null;
var target4 = null;
var target5 = null;
/*??????????????????????*/
var lookups = [];//?????????????????????????
/*???????????????,Netscaper??IE*/
var NS4 = (navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? true : false;
var IE4 = (document.all && !document.getElementById)? true : false;
var IE5 = (document.getElementById && document.all)? true : false;
var NS6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var mx, my;//???????????????0,0
mx=80;
my=80;
/*此函數用傳遞具只有一個表單名稱或表單字段名稱*/
function call_fieldlookup(target, viewName, formName,viewWidth,viewheight) {
var fieldLookup = new fieldLookup1(target);
if (! viewWidth) viewWidth = 250;
if (! viewheight) viewheight = 100;
fieldLookup.popup(viewName, formName, viewWidth, viewheight);
}
function call_fieldlookup2(target, viewName,kuan,gao) {
var fieldLookup = new fieldLookup1(target, arguments,kuan,gao);
fieldLookup.popup2(viewName,kuan,gao);
}
function call_fieldlookup3(target,target2,viewName,kuan,gao) {
var fieldLookup = new fieldLookup2(target,target2,arguments,kuan,gao);
//alert(kuan);
//alert(gao);
fieldLookup.popup2(viewName,kuan,gao);
}
function fieldLookup1(obj_target, args,kuan,gao) {
this.args = args;
// passing methods
this.popup = lookup_popup1;
this.popup2 = lookup_popup2;
this.kuan=kuan;
this.gao=gao;
// validate input parameters
if (!obj_target)
return lookup_error("Error calling the field lookup: no target control specified");
if (obj_target.value == null)
return cal_error("Error calling the field lookup: parameter specified is not valid tardet control");
//this.target = obj_target;
target = obj_target;
// register in global collections
//this.id = lookups.length;
//lookups[this.id] = this;
}
//fieldLookup2 was changed by tie;
function fieldLookup2(obj_target,obj_target2, args,kuan,gao) {
this.args = args;
// passing methods
this.popup = lookup_popup1;
this.popup2 = lookup_popup2;
this.kuan=kuan;
this.gao=gao;
// validate input parameters
if (!obj_target)
return lookup_error("Error calling the field lookup: no target control specified");
if (obj_target.value == null)
return cal_error("Error calling the field lookup: parameter specified is not valid tardet control");
//this.target = obj_target;
target = obj_target;
if (!obj_target2)
return lookup_error("Error calling2 the field lookup: no target control specified");
if (obj_target2.value == null)
return cal_error("Error calling22 the field lookup: parameter specified is not valid tardet control");
target2 = obj_target2;
// register in global collections
//this.id = lookups.length;
//lookups[this.id] = this;
}
/*function fieldLookup2(obj_target, obj_target2,args) {
// passing methods
this.popup = lookup_popup1;
this.popup2 = lookup_popup2;
// validate input parameters
if (!obj_target)
return lookup_error("Error calling the field lookup: no target control specified");
if (obj_target.value == null)
return cal_error("Error calling the field lookup: parameter specified is not valid tardet control");
target = obj_target;
// validate input parameters
if (!obj_target2)
return lookup_error("Error calling2 the field lookup: no target control specified");
if (obj_target2.value == null)
return cal_error("Error calling22 the field lookup: parameter specified is not valid tardet control");
target2 = obj_target2;
// register in global collections
//this.id = lookups.length;
//lookups[this.id] = this;
}*/
function lookup_popup1 (view_name, form_name, viewWidth, viewheight) {
var obj_lookupwindow = window.open(view_name + '?formName=' + form_name + '&id=' + this.id,'FieldLookup', 'width='+viewWidth+',height='+viewheight+',scrollbars=yes,status=no,resizable=yes,top='+my+',left='+mx+',dependent=yes,alwaysRaised=yes');
obj_lookupwindow.opener = window;
obj_lookupwindow.focus();
}
function lookup_popup2 (view_name,kuan,gao) {
var argString = "";
w=kuan;
h=gao;
if (this.args.length > 2) {
for(var i=2; i < this.args.length; i++) {
argString += "&parm" + (i-2) + "=" + this.args[i];
}
}
var sep = "?";
if (view_name.indexOf("?") >= 0) {
sep = "&";
}
var obj_lookupwindow = window.open(view_name + sep + 'id=' + this.id + argString,'null','width='+w+',height='+h+',scrollbars=yes,status=no,resizable=yes,top='+my+',left='+mx+',dependent=yes,alwaysRaised=yes');
obj_lookupwindow.opener = window;
obj_lookupwindow.focus();
}
/*用于編寫一個專門傳遞五個參數的函數*/
function call_fieldlookup5(target, target2,target3,target4,target5, viewName,kuan,gao) {
var fieldLookup = new fieldLookup5(target,target2,target3,target4,target5,arguments,kuan,gao);
fieldLookup.popup2(viewName,kuan,gao);
}
function fieldLookup5(obj_target,obj_target2,obj_target3,obj_target4,obj_target5,args,kuan,gao) {
this.args = args;
// passing methods
this.popup = lookup_popup1;
this.popup2 = lookup_popup2;
this.kuan=kuan;
this.gao=gao;
// validate input parameters
if (!obj_target)
return lookup_error("Error calling the field lookup: no target control specified");
if (obj_target.value == null)
return cal_error("Error calling the field lookup: parameter specified is not valid tardet control");
//this.target = obj_target;
target = obj_target;
if (!obj_target2)
return lookup_error("Error calling2 the field lookup: no target control specified");
if (obj_target2.value == null)
return cal_error("Error calling22 the field lookup: parameter specified is not valid tardet control");
target2 = obj_target2;
if (!obj_target3)
return lookup_error("Error calling3 the field lookup: no target control specified");
if (obj_target3.value == null)
return cal_error("Error calling3 the field lookup: parameter specified is not valid tardet control");
target3 = obj_target3;
if (!obj_target4)
return lookup_error("Error calling4 the field lookup: no target control specified");
if (obj_target4.value == null)
return cal_error("Error calling4 the field lookup: parameter specified is not valid tardet control");
target4 = obj_target4;
if (!obj_target5)
return lookup_error("Error calling5 the field lookup: no target control specified");
if (obj_target5.value == null)
return cal_error("Error calling5 the field lookup: parameter specified is not valid tardet control");
target5 = obj_target5;
}
function call_fieldlookup33(target, target2,target3,viewName,kuan,gao) {
var fieldLookup = new fieldLookup33(target,target2,target3,arguments,kuan,gao);
fieldLookup.popup2(viewName,kuan,gao);
}
function fieldLookup33(obj_target,obj_target2,obj_target3,args,kuan,gao) {
this.args = args;
// passing methods
this.popup = lookup_popup1;
this.popup2 = lookup_popup2;
this.kuan=kuan;
this.gao=gao;
// validate input parameters
if (!obj_target)
return lookup_error("Error calling the field lookup: no target control specified");
if (obj_target.value == null)
return cal_error("Error calling the field lookup: parameter specified is not valid tardet control");
//this.target = obj_target;
target = obj_target;
if (!obj_target2)
return lookup_error("Error calling2 the field lookup: no target control specified");
if (obj_target2.value == null)
return cal_error("Error calling22 the field lookup: parameter specified is not valid tardet control");
target2 = obj_target2;
if (!obj_target3)
return lookup_error("Error calling3 the field lookup: no target control specified");
if (obj_target3.value == null)
return cal_error("Error calling3 the field lookup: parameter specified is not valid tardet control");
target3 = obj_target3;
}
function lookup_error (str_message) {
alert (str_message);
return null;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -