static.scripts.common.SpcialitySelect.js Maven / Gradle / Ivy
// 缺省值
var defaultValues=new Object();
// 页面上所有的三级级联选择
var selects= new Array();
// 当前操作影响的选择
var mySelects=new Array();
// 当前的三级级联选择
var stdTypeDepart3Select=null;
// 初始化学生类别选择框
function initStdTypeSelect(stdTypes){
if( null==document.getElementById(this.stdTypeSelectId)) return;
defaultValues[this.stdTypeSelectId]=document.getElementById(this.stdTypeSelectId).value;
dwr.util.removeAllOptions(this.stdTypeSelectId);
dwr.util.addOptions(this.stdTypeSelectId,stdTypes,'id','name');
if(this.stdTypeNullable){
dwr.util.addOptions(this.stdTypeSelectId,[{'id':'','name':'...'}],'id','name');
}
setSelected(document.getElementById(this.stdTypeSelectId),defaultValues[this.stdTypeSelectId]);
if(null != document.getElementById(this.departSelectId)&&null != document.getElementById(this.majorSelectId)){
document.getElementById(this.stdTypeSelectId).onchange=function (){
notifyMajorChange();
}
}
}
// 初始化部门初始化
function initDepartSelect(departs){
defaultValues[this.departSelectId]=document.getElementById(this.departSelectId).value;
dwr.util.removeAllOptions(this.departSelectId);
dwr.util.addOptions(this.departSelectId,departs,'id','name');
if(this.departNullable)
dwr.util.addOptions(this.departSelectId,[{'id':'','name':'...'}],'id','name');
setSelected(document.getElementById(this.departSelectId),defaultValues[this.departSelectId]);
document.getElementById(this.departSelectId).onchange =function (){
notifyMajorChange();
}
}
// 初始化专业选择框
function initMajorSelect(){
defaultValues[this.majorSelectId]=document.getElementById(this.majorSelectId).value;
dwr.util.removeAllOptions(this.majorSelectId);
document.getElementById(this.majorSelectId).onchange=notifyAspectChange;
var std= document.getElementById(this.stdTypeSelectId);
var d = document.getElementById(this.departSelectId);
if(this.majorNullable)
dwr.util.addOptions(this.majorSelectId,[{'id':'','name':'...'}],'id','name');
if(std.value!=""&&d.value!=""){
stdTypeDepart3Select=this;
majorDao.getMajorNames(d.value,std.value,setMajorOptions);
}
//setSelected(document.getElementById(this.majorSelectId),defaultValues[this.majorSelectId]);
}
// 通知专业变化,填充专业选择列表
function notifyMajorChange(){
//alert("event in notifyMajorChange");
mySelects= getMySelects(event.srcElement.id);
//if(mySelects.length>1)
// dwr.engine.setAsync(false);
for(var i=0;i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy