var url = CMS_SystemConfig.VirtualDirectoryPath + "/OpenObjects/Edit"; var bathval = ""; var mnu; $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }); function reload() { $("#dgOpenObjectsList").cmsXDataTable("load", $.getDataGridParams("dgOpenObjectsList")); } //新增 function OpenObjects_Add(){ var redirectTo = url + '?MNU=' + mnu; $.popupTopWindow('开放对象新增', redirectTo, 550, 200, null, null); } //点击列表更新 function edit(rowindex, rowdata) { var redirectTo = url + '?studentEditObjectsID=' + rowdata.StudentEditObjectsID + '&MNU=' + mnu + '&isView=1'; $.popupTopWindow('开放对象详情', redirectTo, 550, 200, null, null); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgOpenObjectsList").cmsXDataTable("getSelections"), function (index) { d.push(this.StudentEditObjectsID); }); return d; } //修改按钮 function OpenObjects_Update() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的开放对象信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + '?studentEditObjectsID=' + d + '&MNU=' + mnu; $.popupTopWindow('开放对象修改', redirectTo, 550, 200, null, null); } //删除 function OpenObjects_Delete(){ var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的开放对象信息!!"); return; } $.messager.confirm("系统提示", "您确定要删除该开放对象信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/OpenObjects/Delete', { ids: d }, function (data) { if (data == "删除成功") { $.messager.alert("系统提示", "删除成功!"); $("#dgOpenObjectsList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); }