dialog-plus-min.js插件的使用问题,弹出对话框怎么点击后怎么刷新

crawling_wl 2017-07-02 09:19:16
function OpenDialogUrl(id, title, url, width, height, okValue, okfun, cancelValue, cancelfun) {
var d = {};

if (okValue != undefined) {
d = dialog({
id: id,
fixed: true,
title: title,
url: url,
width: width,
height: height,
ok: okfun,
okValue: okValue
});
} else if (cancelValue != undefined) {
d = dialog({
id: id,
fixed: true,
title: title,
url: url,
width: width,
height: height,
ok: okfun,
okValue: okValue,
cancel: cancelfun,
cancelValue: cancelfun
});
} else {
d = dialog({
id: id,
fixed: true,
title: title,
url: url,
width: width,
height: height
});
}

d.showModal();
}

这个插件要怎么用啊。
//增加一条信息
function Add() {
top.OpenDialogUrl("add", "新增", "/Home/AddPage", 500, 750);
//window.location.reload();
}
我想post提交后关闭对话框后刷新页面,但这样写,直接点击就刷新了,求大神解答下。。
...全文
750 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lwq222121 2017-07-20
  • 打赏
  • 举报
回复
var d = dialog({ title: '提示', content: '按钮回调函数返回 false 则不许关闭', okValue: '确定', ok: function () { this.title('提交中…'); return false; }, cancelValue: '取消', cancel: function () {} });
lwq222121 2017-07-20
  • 打赏
  • 举报
回复
没用过这个插件,但是根据经验来讲,dialog({ id: id, fixed: true, title: title, url: url, width: width, height: height });这个里面肯定有一些事件供你配置,比如bootstraptable中就有onloadsuccess,这样子
qq_39567362 2017-07-20
  • 打赏
  • 举报
回复
function showList(obj) { var attachDialog = top.dialog({ title: "请选择大屏位置" , url: '../dialog/dialog_bigScreen_position.aspx?articleid=' + obj, width: 500, height: 200, onclose: function () { location.href = location.href; } }).showModal(); }
EdsionWang 2017-07-03
  • 打赏
  • 举报
回复
window.location.reload() 能刷新的话,说明你放到位置不对。你放到post数据后面去不就可以了吗

     $.ajax({
                url: "@Url.Action("Create")",
                type: "Post",
                data: $("form").serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.type == 1) {
                       window.location.reload(); //post成功了,刷新
                    }
                    else {
                        alert('没成功,出错了');
                    }
                }
            });

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧