var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //获取选中的列表数据(All) function validChoose() { var d = []; $.each($("#dgMinorGraduationConditionList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } //获取列表数据(列表中的所有行数据) function validChooseID() { var d = []; $.each($("#dgMinorGraduationConditionList").cmsXDataTable("getRows"), function (index) { d.push(this.MinorGraduationConditionID); }); return d; } //保存 function MinorGraduationConditionPackage_Save() { var d = validChooseID(); if (d == "") { $.messager.alert("系统提示", "请添加辅修毕业条件。"); return } $(document.forms[0]).submit(); } //添加页面(毕业条件添加) function MinorGraduationConditionAdd() { $.popupTopWindow('辅修毕业条件添加', CMS_SystemConfig.VirtualDirectoryPath + '/MinorGraduationConditionPackage/MinorGraduationConditionList?FromMNU=' + mnu, 600, 420, AddGraduationCondition_Confirm); } //加载选中的信息(毕业条件) function AddGraduationCondition_Confirm(MinorGraduationConditionList) { if (MinorGraduationConditionList == undefined || MinorGraduationConditionList.length < 1) { return; } var minorGraduationConditionViewList = $("#dgMinorGraduationConditionList").cmsXDataTable("getRows"); $.each(MinorGraduationConditionList, function (index, value) { if ($.grep(minorGraduationConditionViewList, function (row, index) { return value.MinorGraduationConditionID == row.MinorGraduationConditionID; }).length == 0) { minorGraduationConditionViewList.push({ MinorGraduationConditionID: value.MinorGraduationConditionID, Title: value.Title, IsEnable: value.IsEnable }); } }); $("#dgMinorGraduationConditionList").cmsXDataTable("loadData", { rows: minorGraduationConditionViewList, total: minorGraduationConditionViewList.length }); } //删除(毕业条件删除) function MinorGraduationConditionDelete() { var d = validChoose(); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } var minorGraduationConditionViewList = $("#dgMinorGraduationConditionList").cmsXDataTable("getRows"); var i, j; var len = minorGraduationConditionViewList.length; for (i = len - 1; i >= 0; i--) { for (j = 0; j < d.length; j++) { if (minorGraduationConditionViewList[i].MinorGraduationConditionID == d[j].MinorGraduationConditionID) { minorGraduationConditionViewList.splice(i, 1); break; } } } $("#dgMinorGraduationConditionList").cmsXDataTable("loadData", { rows: minorGraduationConditionViewList, total: minorGraduationConditionViewList.length }); }