TeacherSelect.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. function reload() {
  2. $("#dgStaffList").cmsXDataTable("load", $.getDataGridParams("dgStaffList"));
  3. }
  4. //获取选中的数据
  5. function validChoose() {
  6. var d = [];
  7. $.each($("#dgStaffList").cmsXDataTable("getSelections"), function (index) {
  8. d.push(this);
  9. });
  10. return d;
  11. }
  12. function QueryCampusDropdownList() {
  13. var campusID = $("#CampusDropdown").combogridX("getValue");
  14. if (campusID != nonSelect) {
  15. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  16. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  17. }
  18. reload();
  19. }
  20. function QueryCollegeDropdownList() {
  21. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  22. if (collegeID != nonSelect) {
  23. var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|'})";
  24. $("#DepartmentDropdown").combogridX("reload", eval(jsonString));
  25. }
  26. reload();
  27. }
  28. function QueryDepartmentDropdownList() {
  29. reload();
  30. }
  31. function QueryPhotoUrltmentDropdownList(data) {
  32. reload();
  33. }
  34. function Teacher_Confirm() {
  35. var d = validChoose();
  36. var windowID = $.SystemGeneral.getUrlParam("WindowID");
  37. var maxSelect = $.SystemGeneral.getUrlParam("MaxSelect");
  38. if (!maxSelect || isNaN(maxSelect)) maxSelect = 0;
  39. if (d.length == 0) {
  40. $.messager.alert("系统提示", "请选择教师。");
  41. return;
  42. }
  43. if (maxSelect > 0 && d.length > maxSelect) {
  44. $.messager.alert("系统提示", "只能选择" + maxSelect + "项记录。");
  45. return;
  46. }
  47. top.$("#" + windowID).data("resultData", d);
  48. top.$("#" + windowID).dialog("close");
  49. }