1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- var inputData;
- var windowID;
- $.parser.onComplete = function () {
- $(function () {
- windowID = $.SystemGeneral.getUrlParam("WindowID");
- inputData = top.$("#" + windowID).data("inputData");
- reload();
- });
- };
- function reload() {
- var grid = $("#dgStudentList");
- var allSetting = $.data(grid[0], "cmsXDataTable");
- if (!allSetting) return;
- allSetting.options.url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationPlan/StudentList?examinationPlanID=" + inputData.examinationPlanID + "&studentOrderTypeID=" + inputData.studentOrderType;
- $.data(grid, "cmsXDataTable", allSetting);
- grid.cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- //院系所
- function SelectCollegeComboGrid() {
- var collegeID = $("#CollegeComboGrid").combogridX("getValue");
- if (collegeID != nonSelect) {
- var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|'})";
- $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
- }
- reload();
- }
- function SelectGrademajorComboGrid() {
- var grademajorID = $("#GrademajorComboGrid").combogridX("getValue");
- if (grademajorID != nonSelect) {
- var jsonString = "({'QueryParamsDatas':'GrademajorComboGrid|*|" + grademajorID + "|@|'})";
- $("#ClassmajorComboGrid").combogridX("reload", eval(jsonString));
- }
- reload();
- }
- function Student_Confirm() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要添加的学生。");
- return;
- }
- if (d.length > inputData.limit) {
- $.messager.alert("系统提示", "由于座位安排的限制,目前该教室只能再容纳" + inputData.limit + "人。");
- return;
- }
- top.$("#" + windowID).data("resultData", d);
- top.$("#" + windowID).dialog("close");
- }
- function Student_MaxConfirm() {
- if (inputData.limit <= 0) {
- $.messager.alert("系统提示", "该考场人数已满,点击确定回到上一页。", 'info', function () {
- top.$("#" + windowID).dialog("close");
- });
- return;
- }
- var grid = $("#dgStudentList");
- var allSetting = $.data(grid[0], "cmsXDataTable");
- if (!allSetting) return;
- allSetting.options.pagination = false;
- allSetting.options.onLoadSuccess = function (data) {
- var d = [];
- $.each($("#dgStudentList").cmsXDataTable("getRows"), function (index) {
- if (index < inputData.limit) {
- d.push(this);
- }
- });
- if (d.length == 0) {
- $.messager.alert("系统提示", "请选择您要添加的学生。");
- return;
- }
- top.$("#" + windowID).data("resultData", d);
- top.$("#" + windowID).dialog("close");
- };
- $.data(grid, "cmsXDataTable", allSetting);
- grid.cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
- }
|