日期:2014-05-16 浏览次数:20469 次
function initSelectQ(){ var jdSelect = document.getElementById('jdSelect'); dwr.engine.setAsync(false);//设置dwr方法同步 GridService.selectTShsjglJd({},function(data){ var varItemk = new Option("", ""); jdSelect.options.add(varItemk); for(var i=0;i<data.length;i++){ var zbmoption = document.createElement("option"); zbmoption.text = data[i].jdmc; zbmoption.value = data[i].id; jdSelect.options.add(zbmoption); } }); dwr.engine.setAsynctrue);//恢复dwr方法异步 initSelect(); } function initSelect(){ //setTimeout(selectJdSqWg, 500); selectJdSqWg(); } function selectJdSqWg() { var wgname; var sqname; var jdname; var jdSelect = document.getElementById('jdSelect'); var sqSelect = document.getElementById('sqSelect'); var wgSelect = document.getElementById('wgSelect'); dwr.engine.setAsync(false);//设置dwr方法同步 GridService.selectWgInfoByLoginCode('${ryqyVO.mbwgCode}',function(data){ if(data){ if(data.length >0){ jdname=data[0].jdmc; sqname=data[0].sqmc; wgname=data[0].wgmc; for(var i=0;i<jdSelect.options.length;i++){ if(jdSelect.options[i].text == jdname) { jdSelect.options[i].selected = true; changeJD(jdSelect.options[i].value); break; } } //alert(1); for(var i=0;i<sqSelect.options.length;i++){ if(sqSelect.options[i].text == sqname) { sqSelect.options[i].selected = true; changeSQ(sqSelect.options[i].value); break; } } //alert(2); for(var i=0;i<wgSelect.options.length;i++){ if(wgSelect.options[i].text == wgname) { wgSelect.options[i].selected = true; break; } } } } }); dwr.engine.setAsync(true);//恢复dwr方法异步 }