//********************************** //教师端-----学生成绩管理 //********************************** $(function () { var classid = 0; var searchVal = ""; //加载班级 SetSelectList("SelectClass"); //加载页面 LoadScoreMangerList(); // 选择列表班级赛选 //$("#SelectClass").unbind("change").bind("change", function () { // classid = $(this).val(); // SetPageList(classid); //}); $("#ScoreKeyWord").unbind("focus").focus(function () { $("#ScoreKeyWord").val("").css("color", "black"); }) $("#btnSearch").unbind("click").bind("click", function () { classid = $("#SelectClass").val(); searchVal = $("#ScoreKeyWord").val().replace(/[<>&"]/g, function (c) { return { '<': '<', '>': '>', '&': '&', '"': '"', '"': '"', "'": '′', "'": '′' }[c]; }); if (searchVal == "学号/姓名") { searchVal = "";} SetPageList(classid, searchVal); }); }) //初次加载 function LoadScoreMangerList() { SetPageList(); }; //搜索加载 function SearchLoadPage() { var ScoreKeyWord = $("#ScoreKeyWord").val(); var KeyWord = null; if (ScoreKeyWord != null && ScoreKeyWord != "" && ScoreKeyWord.length > 0) { KeyWord = ScoreKeyWord } SetPageList(0, KeyWord); } //加载班级下拉列表 function SetSelectList(SelectId) { selectHelper.GetSelect({ url: "/Teacher/ScoreManager/LoadSelectList", Id: "#" + SelectId, value: "全部", data: {} }) } //设置列表 function SetPageList(ClassId, keyWord) { if (typeof ClassId =="undefined") { ClassId = 0; }; if (typeof keyWord == "undefined") { keyWord = ""; }; $("#ScoreTab tbody").html(""); pageHelper.Init({ url: "/Teacher/ScoreManager/LoadStudentList", type: "POST", pageDiv: "#Pages", data: { ClassId: ClassId, keyWord: keyWord, rId: Math.random() }, bind: function (data) { var bodyhtml = ""; if (data.Data != null) { //先加载下拉列表 $(data.Data).each(function (index, dom) { var html = ""; html += ""; html += "
{0}
"; html += "
{1}
"; html += "
{2}
"; html += "" html += "查看" html += ""; html += "" bodyhtml += StringHelper.FormatStr(html, dom.SchoolNumber, // 0学号 dom.UserName, //1姓名 dom.ClassName, //2班级名称 dom.Id ) }); } $("#ScoreTab tbody").html(bodyhtml); } }); }; //展示试图 function ViewShow(userid) { window.location.href = "/Teacher/ScoreManager/ScoreDetail?userId=" + userid; }