var url = CMS_SystemConfig.VirtualDirectoryPath + "/FreeSelectionCourse/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //新增 function FreeSelectionCourse_Add() { var d = validChoose(); if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行复制新增。"); return; } redirectTo = url + "?freeSelectionCourseIDs=" + d+ "&MNU=" + mnu + "&type=copyAdd"; $.popupTopWindow("任选课程新增", redirectTo, 650, 550, null, null); } function reload() { $("#dgFreeSelectionCourseList").cmsXDataTable("load", $.getDataGridParams("dgFreeSelectionCourseList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgFreeSelectionCourseList").cmsXDataTable("getSelections"), function (index) { d.push(this.FreeSelectionCouseID); }); return d; } //点击列表更新 function edit(rowindex, rowdata) { redirectTo = url + "?freeSelectionCourseIDs=" + rowdata.FreeSelectionCouseID + "&MNU=" + mnu + "&IsDisplay=false"; $.popupTopWindow("任选课程信息", redirectTo, 650, 550, null, null); } //修改按钮 function FreeSelectionCourse_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要修改的信息。"); return; } if (d.length > 1) { $.messager.alert("系统信息", "只能选择单个记录进行修改。"); return; } redirectTo = url + "?freeSelectionCourseIDs=" + d+ "&MNU=" + mnu ; $.popupTopWindow("任选课程修改", redirectTo, 650, 550, null, null); } //删除 function FreeSelectionCourse_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统信息", "请选择您要删除的信息!!"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/FreeSelectionCourse/Delete', { freeSelectionCourseIDs: d }, function (data) { if (data == "删除成功!") { $.messager.alert("系统提示", data); $("#dgFreeSelectionCourseList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function FreeSelectionCourse_Export() { $("#formQuery").submit(); } function QueryCoursematerialComboGrid(data) { reload(); } function QuerySpecialtyComboGrid(data) { reload(); } function QuerySchoolcodeDropdownList(data) { reload(); } function QueryStarttermDropdownList(data) { reload(); } function QueryIsEnableDropdownList(data) { reload(); }