TeacherSelector.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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(data) {
  13. $("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + "");
  14. reload();
  15. }
  16. function QueryCollegeDropdownList(data) {
  17. $("#DepartmentDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?collegeID=" + data.Value + "");
  18. reload();
  19. }
  20. function QueryDepartmentDropdownList(data) {
  21. reload();
  22. }
  23. function QueryPhotoUrltmentDropdownList(data) {
  24. reload();
  25. }
  26. function Teacher_Confirm() {
  27. var d = validChoose();
  28. var windowID = $.SystemGeneral.getUrlParam("WindowID");
  29. var maxSelect = $.SystemGeneral.getUrlParam("MaxSelect");
  30. if (!maxSelect || isNaN(maxSelect)) maxSelect = 0;
  31. if (d.length == 0) {
  32. $.messager.alert("系统提示", "请选择教师。");
  33. return;
  34. }
  35. if (maxSelect > 0 && d.length > maxSelect) {
  36. $.messager.alert("系统提示", "只能选择" + maxSelect + "项记录。");
  37. return;
  38. }
  39. top.$("#" + windowID).data("resultData", d);
  40. top.$("#" + windowID).dialog("close");
  41. }