?? 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 + -