EasyUI 动态创建对话框Dialog
2017-02-22 21:13
447 查看
// 拒绝审批通过 function rejectApproval() { // 创建填写审批意见对话框 $("<div id='reject-comment'> </div>").dialog({ title: '请填写拒绝审批通过意见', closable: true, width: 350, height: 250, content: "<textarea id='input-comment' />", buttons: [{ text: '确定', iconCls: 'icon-ok', handler: function () { if (canEdit == true) { var year = parseInt($('#queryYear').numberbox('getValue')); var month = parseInt($('#queryMonth').numberbox('getValue')); var comment = $('#input-comment').val(); // 审批意见可能较长,不适合拼接在url中,使用表单传输 var fd = new FormData(); fd.append("comment", comment); // 后台处理数据时先显示一个提示框,防止用户多次点击【保存】重复提交数据 $.messager.progress({ title: '提示', msg: '正在保存,请稍候……', }); $.ajax({ type: "delete", url: '/api/Approval?year=' + year + '&month=' + month, processData: false, contentType: false, data: fd, success: function (data) { if (!data.State) { $.messager.alert('错误', data.Data, 'warning'); } else { $('#dg').datagrid('reload'); editRow = -1; $('#reject-comment').dialog('destroy'); } $('#dg').datagrid('unselectAll'); }, error: function () { $.messager.alert('警告', data.Data, 'info'); $('#dg').datagrid('unselectAll'); } }); } } }, { text: '取消', iconCls: 'icon-cancel', // 点击“取消”按钮,销毁对话框 handler: function () { $('#reject-comment').dialog('destroy'); } }], // 点击右上角的“X”图标时 onClose: function () { $(this).dialog('destroy'); } }); }
界面是酱紫滴……
PS:记几个
dialog的用法
获取
dialog宽高
$('#dlg').dialog('panel').width(); $('#dlg').dialog('panel').height();
更改
dialog的弹出位置
在弹出
dialog的时候不用
$('#dialogDiv').dialog('open');打开。用
$('#dialogDiv').window('open');打开。再用
window的
resize方法重新布局即可。
var top = 200; var left = window.innerWidth / 2 - $('#dlg').dialog('panel').width() / 2; $('#dialogDiv').window('open').window('resize',{width:'250px', height:'500px', top: top, left: left});
相关文章推荐
- 用easyui动态创建一个对话框
- easyUI 创建Dialog对话框
- easyui动态创建一个dialog
- easyui 动态创建模式对话框
- easyUI 创建Dialog对话框
- EasyUI动态创建、删除模态Dialog
- EasyUi常用组件(四)Dialog对话框、创建按钮(Buttons)、创建工具栏(Toolbar)
- 使用onCreateDialog创建Dialog,并且动态修改Dialog的信息
- dialogPostRun 覆盖方法class Dialog 动态创建
- 对话框的动态创建 转
- Android: 创建一个AlertDialog对话框,必须按确定或取消按钮才能关闭对话框,禁止按[返回键]或[搜索键]关闭
- vc 动态创建对话框和按钮
- jQuery EasyUI API 中文文档 - Dialog对话框
- 对话框dialog创建深入探索
- 不使用资源文件动态创建对话框的做法
- [原]不使用资源文件动态创建对话框的做法
- Android中对话框(Dialog)的创建方法
- How to load a dll resource dialog box at an application Dialog box (怎么在一个应用程序对话框动态加载DLL里的资源对话框)
- 用Dialog创建带箭头的对话框
- 对话框和MDI中动态创建按钮CButton,并响应事件