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提交后关闭对话框后刷新页面,但这样写,直接点击就刷新了,求大神解答下。。

解决方案 »

  1.   

    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('没成功,出错了');
                        }
                    }
                });
      

  2.   

      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();
            }
      

  3.   

    没用过这个插件,但是根据经验来讲,dialog({
                id: id,
                fixed: true,
                title: title,
                url: url,
                width: width,
                height: height
            });这个里面肯定有一些事件供你配置,比如bootstraptable中就有onloadsuccess,这样子
      

  4.   

    var d = dialog({
        title: '提示',
        content: '按钮回调函数返回 false 则不许关闭',
        okValue: '确定',
        ok: function () {
            this.title('提交中…');
            return false;
        },
        cancelValue: '取消',
        cancel: function () {}
    });