?? option.js
字號(hào):
/////////////////////////////////////////////////////////////////
//參數(shù)說(shuō)明:
//參數(shù) 類(lèi)型 含義
//theObj: String 選擇的控件名稱或ID
//theTable: String 確定數(shù)據(jù)庫(kù)表名
//theValueField: String 在列表框的值的字段
//theTextField: String 在列表框的顯示的字段
//theWhere: String 確定檢索條件
//theQuery: String 確定檢索語(yǔ)句(與theTable是互斥)
//theTitle: String 對(duì)話窗口的標(biāo)題
//itheRelateUrl: int 當(dāng)前目錄相對(duì)于option的層數(shù)
////////////////////////////////////////////////////////////////
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("參數(shù)無(wú)效!\r\n,請(qǐng)檢查參數(shù)是否正確。");
return;
}
if (theValueField=="" && theTextField=="")
{
alert("請(qǐng)確定列表信息的有效參數(shù)。");
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
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -