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