WeekModify.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. var windowID;
  2. var inputData;
  3. var educationSchedulingID;
  4. var weeklyNums;
  5. $.parser.onComplete = function () {
  6. $(function () {
  7. windowID = $.SystemGeneral.getUrlParam("WindowID");
  8. inputData = top.$("#" + windowID).data("inputData");
  9. educationSchedulingID = inputData.EducationSchedulingID;
  10. weeklyNums = inputData.WeeklyNums.sort(function (a, b) { return parseInt(a) - parseInt(b); });
  11. var gridData = { rows: $.map(inputData.WeeklyNums, function (x) { return { WeekNum: x }; }), total: inputData.WeeklyNums.length };
  12. $("#dgWeekList").cmsXDataTable("loadData", gridData);
  13. });
  14. };
  15. function validChoose() {
  16. var d = [];
  17. $.each($("#dgWeekList").cmsXDataTable("getSelections"), function (index) {
  18. d.push(this.WeekNum);
  19. });
  20. return d;
  21. }
  22. function deleteWeeks() {
  23. var d = validChoose();
  24. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/DeleteWeeks',
  25. { educationSchedulingID: educationSchedulingID, weekListStr: d.join(',') },
  26. function(data) {
  27. if (data.IsSuccess) {
  28. $.messager.alert("系统提示", "删除成功!");
  29. top.$("#" + windowID).data("isSuccess", true);
  30. top.$("#" + windowID).dialog("close");
  31. } else {
  32. $.messager.alert("系统提示", data.Message);
  33. }
  34. });
  35. }