CoursematerialSelect.js 944 B

123456789101112131415161718192021222324252627282930313233
  1. 
  2. function reload() {
  3. $("#dgCoursematerialList").cmsXDataTable("load", $.getDataGridParams("dgCoursematerialList"));
  4. }
  5. //获取选中的数据
  6. function validChoose() {
  7. var d = [];
  8. $.each($("#dgCoursematerialList").cmsXDataTable("getSelections"), function (index) {
  9. d.push(this);
  10. });
  11. return d;
  12. }
  13. function Coursematerial_Confirm() {
  14. var d = validChoose();
  15. var windowID = $.SystemGeneral.getUrlParam("WindowID");
  16. var maxSelect = $.SystemGeneral.getUrlParam("MaxSelect");
  17. if (!maxSelect || isNaN(maxSelect)) maxSelect = 0;
  18. if (d.length == 0) {
  19. $.messager.alert("系统提示", "请选择至少一门课程。");
  20. return;
  21. }
  22. if (maxSelect > 0 && d.length > maxSelect) {
  23. $.messager.alert("系统提示", "只能选择" + maxSelect + "项记录。");
  24. return;
  25. }
  26. top.$("#" + windowID).data("resultData", d);
  27. top.$("#" + windowID).dialog("close");
  28. }