OpenObjects.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/OpenObjects/Edit";
  2. var bathval = "";
  3. var mnu;
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. });
  7. function reload() {
  8. $("#dgOpenObjectsList").cmsXDataTable("load", $.getDataGridParams("dgOpenObjectsList"));
  9. }
  10. //新增
  11. function OpenObjects_Add(){
  12. var redirectTo = url + '?MNU=' + mnu;
  13. $.popupTopWindow('开放对象新增', redirectTo, 550, 200, null, null);
  14. }
  15. //点击列表更新
  16. function edit(rowindex, rowdata) {
  17. var redirectTo = url + '?studentEditObjectsID=' + rowdata.StudentEditObjectsID + '&MNU=' + mnu + '&isView=1';
  18. $.popupTopWindow('开放对象详情', redirectTo, 550, 200, null, null);
  19. }
  20. //获取选中的数据
  21. function validChoose() {
  22. var d = [];
  23. $.each($("#dgOpenObjectsList").cmsXDataTable("getSelections"), function (index) {
  24. d.push(this.StudentEditObjectsID);
  25. });
  26. return d;
  27. }
  28. //修改按钮
  29. function OpenObjects_Update() {
  30. var d = validChoose();
  31. if (d.length == 0) {
  32. $.messager.alert("系统提示", "请选择您要修改的开放对象信息。");
  33. return;
  34. }
  35. if (d.length > 1) {
  36. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  37. return;
  38. }
  39. var redirectTo = url + '?studentEditObjectsID=' + d + '&MNU=' + mnu;
  40. $.popupTopWindow('开放对象修改', redirectTo, 550, 200, null, null);
  41. }
  42. //删除
  43. function OpenObjects_Delete(){
  44. var d = validChoose().join(',');
  45. if (d == "") {
  46. $.messager.alert("系统提示", "请选择您要删除的开放对象信息!!");
  47. return;
  48. }
  49. $.messager.confirm("系统提示", "您确定要删除该开放对象信息?", function (r) {
  50. if (r) {
  51. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/OpenObjects/Delete', { ids: d }, function (data) {
  52. if (data == "删除成功") {
  53. $.messager.alert("系统提示", "删除成功!");
  54. $("#dgOpenObjectsList").cmsXDataTable('load');
  55. } else {
  56. $.messager.alert("系统提示", data);
  57. }
  58. });
  59. }
  60. });
  61. }