//动态获取主题数据 function getzts(){ parentId = document.getElementById("bselect1").value; if(parentId!=""){ dwrMethod.getZtList(parentId,callback5); }else{ //清空主题Table的数据 var t=document.getElementById("zhutiTable"); //获取Table var length= t.rows.length; //获得Table下的行数 if(length!=0){ //如果有行,则清空 for(var i=length-1;i>=0;i--) { t.deleteRow(i); } } var r = t.insertRow(); var c = r.insertCell(); c.innerHTML="暂无主题列表"; document.getElementById('zhutiTable').appendChild(t); } } function callback5(provinces){ var t=document.getElementById("zhutiTable"); //获取Table var length= t.rows.length; //获得Table下的行数 if(length!=0){ //如果有行,则清空 for(var i=length-1;i>=0;i--) { t.deleteRow(i); } } if(provinces.length>0){ for (var i = 0; i < provinces.length; i++) { //tr if(i%4==0){ var r = t.insertRow(t.rows.length);//创建新的行 } //td var c = r.insertCell(); //创建新的列 c.innerHTML = "<input type='checkbox' name='zhutiIds' value="+provinces[i][0]+">"+provinces[i][1]; } }else{ var r = t.insertRow(); var c = r.insertCell(); c.innerHTML="暂无主题列表"; } document.getElementById('zhutiTable').appendChild(t); }