ClubCourse.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ClubCourse/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgClubCourseList").cmsXDataTable("load", $.getDataGridParams("dgClubCourseList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgClubCourseList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.ClubCourseID);
  16. });
  17. return d;
  18. }
  19. //批量新增
  20. function ClubCourse_BatchAdd() {
  21. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ClubCourse/BatchAdd" + "?MNU=" + mnu;
  22. $.popupTopWindow('俱乐部课程新增', redirectTo, 750, 520, reload, null);
  23. }
  24. //删除
  25. function ClubCourse_Delete() {
  26. var d = validChoose().join(',');
  27. if (d == "") {
  28. $.messager.alert("系统提示", "请选择您要删除的信息。");
  29. return;
  30. }
  31. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  32. if (r) {
  33. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ClubCourse/Delete', { clubCourseIDs: d }, function (data) {
  34. if (data == "删除成功。") {
  35. $.messager.alert("系统提示", data);
  36. $("#dgClubCourseList").cmsXDataTable('load');
  37. } else {
  38. $.messager.alert("系统提示", data);
  39. }
  40. });
  41. }
  42. });
  43. }
  44. //设置列颜色为红色
  45. function SetRedColumn(index, row, value) {
  46. return " <span style=\"color: red;\">" + value + "</span>";
  47. }
  48. //设置相应的行颜色为红色
  49. function SetRedGrid(rowIndex, rowData) {
  50. if (rowData.IsEnable != true) {
  51. return "color: red;";
  52. } else {
  53. return "";
  54. }
  55. }
  56. //Excel导出
  57. function ClubCourse_Export() {
  58. $("#formQuery").submit();
  59. }