Jeecg 重写编辑按钮相关的 js 方法
来源:互联网 发布:网络十大恐怖图片 编辑:程序博客网 时间:2024/06/05 11:36
1. XXXList.jsp 中 dgToolBar 中的自定义函数 funname 方法,原方法在 src/main/webapp/plug-in/tools/curdtools_zh-cn.js 中
<t:dgToolBar title="编辑" icon="icon-edit" url="meetingController.do?goUpdate" funname="update" operationCode="${hideEditButton}"></t:dgToolBar>
/** * 重写更新事件打开窗口 * @param title 编辑框标题 * @param url//目标页面地址 * @param id//主键字段 */function update(title,url, id,width,height,isRestful) { gridname=id; var rowsData = $('#'+id).datagrid('getSelections'); if (!rowsData || rowsData.length==0) { tip('请选择编辑项目0'); return; } if (rowsData.length>1) { tip('请选择一条记录再编辑'); return; } if(isRestful!='undefined'&&isRestful){ url += '/'+rowsData[0].id; }else{ url += '&id='+rowsData[0].id; } createwindow(title,url,width,height);}
2. XXX-update.jsp 中 FormValidation 里执行 controller 前的方法 beforeSubmit 和回调函数 callback
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="meetingController.do?doUpdate" beforeSubmit="checkSubmit" callback="@Override afterUpdate">
beforeSubmit : 表单提交前的处理函数,直接调用就好了
callback : 表单提交完成后的回调函数,如果 dialog="true"的话 callback="@Override functionName" 调用的是当前页面的方法, callback="functionName" 调用的是父页面的方法 如果 dialog="false" callback="functionName" 调用的是 当前页面的方法, 系统自带的回调方法可以自动关闭编辑窗口和右下角显示提示信息,方法我也写在下面重写的方法里了
/** * 重写编辑的回调函数 * @param data * @returns {boolean} */function afterUpdate(data) { var win = frameElement.api.opener; if (data.success == true) { frameElement.api.close(); win.tip(data.msg); } else { if (data.responseText == '' || data.responseText == undefined) { $.messager.alert('错误', data.msg); $.Hidemsg(); } else { try { var emsg = data.responseText.substring(data.responseText.indexOf('错误描述'), data.responseText.indexOf('错误信息')); $.messager.alert('错误', emsg); $.Hidemsg(); } catch (ex) { $.messager.alert('错误', data.responseText + ""); $.Hidemsg(); } } return false; } win.reloadTable();}以上在 Jeecg 3.7 版本中使用
阅读全文
0 0
- Jeecg 重写编辑按钮相关的 js 方法
- JEECG -js方法存放文件
- JEECG -js方法存放文件
- 重写Ckeditor的save按钮方法
- 重写Ckeditor的Save按钮保存方法
- 按钮相关的JS代码大全
- 重写js的replaceAll的方法
- 重写EAS标准单据分录的删除按钮的方法
- 重写按钮的方法,改变其图片的大小
- JS的toFixed方法出错 重写
- JS的toFixed方法出错 重写
- js方法的重写和重载
- JEECG树相关网上找的资料
- c#重写TabControl控件实现关闭按钮的方法
- js重写方法
- js重写方法
- JS方法重写
- JS方法重写
- iOS KVO的优势及缺点
- [MongoDB] Mongodb的初应用
- 一篇不一样的StringBuffer和StringBuilder
- linux运维故障定位汇总
- Ubuntu安装python3
- Jeecg 重写编辑按钮相关的 js 方法
- Install OpenCV 2.4.9 in Ubuntu 14.04, 13.10(Ubuntu 14.04, 13.10 下安装 OpenCV 2.4.9)
- Oracle数据库的卸载
- 【Android开发点滴】Android Studio常用快捷键
- Bootstrap table 服务器端分页示例
- centos下的mysql-cluster集群安装
- Lecture 2: Operators and operands; statements; branching, conditionals, and iteration
- C++中一些知识总结
- Redis 命令