日期:2014-05-16 浏览次数:20369 次
<script type="text/javascript">
var StudentInfoList = new Array();
function SearchStudent() {
var tbSelectStudent = document.getElementById("tbSelectStudent");
if (tbSelectStudent.rows.length > 1) {
for (var i = 0; i < tbSelectStudent.rows.length; i++) {
tbSelectStudent.deleteRow(1);
}
}
$.post("xxx.ashx", { "func": "ffff", "t": escape(telNum) }, function (resultJSON) {
if (resultJSON == "") {
$.dialog.tips("未查询到数据,请检查搜索条件是否正确!", 2, "hits.png");
$("#divSelect").hide();
} else {
StudentInfoList = eval(resultJSON);
if (StudentInfoList.length == 1) {
$.dialog.tips("正在查询学生信息,请稍后...", 1, "loading.gif", function () {
showStudentInfo(0);
});
$("#divSelect").hide();
} else {
$.dialog.tips("正在查询学生信息,请稍后...", 1, "loading.gif", function () {
var newRowIndex = 1;
$.each(StudentInfoList, function () {
var newTableRow = tbSelectStudent.insertRow(newRowIndex);
var newCell0 = tbSelectStudent.rows[newRowIndex].insertCell(0);
newCell0.innerHTML = this.SchoolName;
var newCell1 = tbSelectStudent.rows[newRowIndex].insertCell(1);
newCell1.innerHTML = this.ClassName;
var newCell2 = tbSelectStudent.rows[newRowIndex].insertCell(2);
newCell2.innerHTML = this.StudentName;
var newCell3 = tbSelectStudent.rows[newRowIndex].insertCell(3);
newCell3.innerHTML = this.TelNum;
var newCell4 = tbSelectStudent.rows[newRowIndex].insertCell(4);
newCell4.innerHTML = this.Flag;
var newCell5 = tbSelectStudent.rows[newRowIndex].insertCell(5);
newCell5.innerHTML = this.CardCode;
var newCell6 = tbSelectStudent.rows[newRowIndex].insertCell(6);
newCell6.innerHTML = "<a href=\"javascript:void(0)\" onclick=\"showStudentInfo(" + (newRowIndex - 1) + ");\">选择</a>";
newRowIndex++;
});
var currentcolor = "";
$("#tbSelectStudent").find("tr").mouseover(function () {
currentcolor = this.style.backgroundColor;
this.style.backgroundColor = "#D4EBFF";
});
$("#tbSelectStudent").find("tr").mouseout(function () {
this.style.backgroundColor = currentcolor;
});
});
$("#divSelect").show();
}
}
});
}
</script>
?for?(var?i?=?0;?i?<?tbSelectStudent.rows.length;?i++)?{
????????????????tbSelectStudent.deleteRow(1);
????????????}
while(tbSelect