📄 option.js
字号:
/////////////////////////////////////////////////////////////////
//参数说明:
//参数 类型 含义
//theObj: String 选择的控件名称或ID
//theTable: String 确定数据库表名
//theValueField: String 在列表框的值的字段
//theTextField: String 在列表框的显示的字段
//theWhere: String 确定检索条件
//theQuery: String 确定检索语句(与theTable是互斥)
//theTitle: String 对话窗口的标题
//itheRelateUrl: int 当前目录相对于option的层数
////////////////////////////////////////////////////////////////
function getList(theObj,theTable,theValueField,theTextField,theWhere,theQuery,theTitle,itheRelateUrl)
{
var Url,x,y,style,theValue,theParams;
if (window.document.getElementById(theObj).className=="ReadOnly")
return;
var temp="";
x=new String("");
y=new String("");
y=window.event.screenY;
x=window.event.screenX-100;
if (theTable==null)
theTable="";
theTable=replaceTheChar(theTable,"/"," ");
if (theValueField==null)
theValueField="";
theValueField=replaceTheChar(theValueField,"/"," ");
if (theTextField==null)
theTextField="";
theTextField=replaceTheChar(theTextField,"/"," ");
if (theWhere==null)
theWhere="";
theWhere=replaceTheChar(theWhere,"/"," ");
theWhere=replaceTheChar(theWhere,"=","^");
theWhere=replaceTheChar(theWhere,"#","$");
theWhere=replaceTheChar(theWhere,"|","/");
if (theQuery==null)
theQuery="";
theQuery=replaceTheChar(theQuery,"=","^");
theQuery=replaceTheChar(theQuery,"#","$");
if (theTitle==null)
theTitle="";
theTitle=replaceTheChar(theTitle,"/"," ");
if (theTable=="" && theValueField=="" && theTextField=="" && theWhere=="" && theQuery=="")
{
alert("参数无效!\r\n,请检查参数是否正确。");
return;
}
if (theValueField=="" && theTextField=="")
{
alert("请确定列表信息的有效参数。");
return;
}
if (itheRelateUrl==null)
itheRelateUrl=2;
for (i=1;i<=itheRelateUrl;i++)
temp+="../";
Url=temp+"/option/option.jsp";
theParams="?theTable="+theTable+"&theValueField="+theValueField;
theParams+="&theTextField="+theTextField+"&theWhere="+theWhere;
theParams+="&theSQL="+theQuery+"&theTitle="+theTitle;
Url+=theParams;
style="status:no;help:no;dialogWidth:1;dialogHeight:1;dialogTop:"+y+";dialogLeft:"+x;
theValue=window.showModalDialog(Url,null,style);
if (theValue!=null)
window.document.getElementById(theObj).value=theValue;
return ((theValue==null)?"":theValue);
}
function replaceTheChar(theData,theOrginChar,thereplaceTheChar)
{
if (theData=="" || theData==null)
return theData;
while (theData.indexOf(theOrginChar)!=-1)
{
theData=theData.replace(theOrginChar,thereplaceTheChar);
}
return theData
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -