• 打开模态窗体,并获取返回值、刷新


    JS:
    <script src="/Scripts/lhgdialog/lhgdialog.min.js?self=true&skin=idialog" type="text/javascript"></script>

    //父页面
    var api, W;
                try {
                    if (frameElement != undefined) {
                        api = frameElement.api;
                        W = api.opener;
                    }
                }
                catch (e) { }


    //新增

                function add() {
                    if (currentTreeNode != null) {
                        var dialog = WindowDialog("Add.aspx?parId=" + currentTreeNode.id + "&type=" + currentTreeNode.type + "&HandlerType=add&rand=" + newCommon.atrand(10000000), "新增通讯录"500300);
                        var dialogreload = dialog.reload;
                        dialog.reload = function () {
                            dialog.close();
                            window.location.reload();
                            return false;
                        }
                    } else
                        parent.alertErrorMsg("请先选择节点!");
                }



    //子页面
    var api = frameElement.api;
            $(function () {

            });

    // 提交
            function SubmitForm() {
                var valid = $("#SubmitForm").form("validate");
                if (valid) {
                    $("<div id="datagridmask" class="datagrid-mask"></div>").css({ display: "block",  "100%", height: $(window).height() }).appendTo("body");
                    $("<div id="datagridmaskmsg" class="datagrid-mask-msg"></div>").html("正在处理,请稍候...").appendTo("body").css({ display: "block", left: ($(document.body).outerWidth(true) - 150) / 2, top: ($(window).height() - 45) / 2 });
                    $.post('ExOperate.ashx?HandlerType=add', $("#SubmitForm").serialize(), function (data) {
                        $("#datagridmask").remove();
                        $("#datagridmaskmsg").remove();
                        if (data.State == "1") {
                            api.returnValue = eval("({ id: '" + $("#hidRecordID").val() + "', pId: '" + '<%= Request.QueryString["parId"] %>' + "', name: '" + $("#FolderName").val() + "',iconSkin:'folder'})");
                            api.reload();
                        } else
                            $.messager.alert("系统提示", data.Message, "error");
                    }, "json");
                }
            }
            $(function () {
                $('#FolderUrl').val('<%=Request.UserHostName %>');
            });


    //子页面2:

    var api = null;
            var W = null;
            try {
                if (frameElement.api != null) {
                    api = frameElement.api;
                    W = api.opener;
                }
            } catch (e) { }


    //确定
            function ok() {
                var ids = "";
                var nodes = $.fn.zTree.getZTreeObj("treeAdd").getNodes();
                if (nodes != null && nodes.length > 0) {
                    for (var i = 0; i < nodes.length; i++) {
                        if (nodes[i].iconSkin == "person") {
                            if (ids != "")
                                ids += ",";
                            ids += "{UserCode:'" + nodes[i].id + "',UserName:'" + nodes[i].name + "',SJH:'" + nodes[i].sjh + "',RYLX:'" + nodes[i].rylx + "', XBM:'" + nodes[i].xbm + "'}";
                        }
                    }
                    if (ids == "")
                        $.messager.alert("系统提示""请选择人员!""error");
                    else {
                        ids = "[" + ids + "]";
                        if (api != null && api.data != null) {
                            api.data.fGetOrgUser(eval(ids));
                            api.close();
                        }
                        else if (W != undefined) {
                            W.fGetOrgUser(eval(ids));
                            api.close();
                        }
                        else {
                            window.returnValue = eval(ids);
                            window.close();
                        }
                    }
                }
                else
                    $.messager.alert("系统提示""请选择人员!""error");
            }
  • 相关阅读:
    MySql 免安装配置
    MySql 语句优化的几个小建议
    Sharding-JDBC 公共表
    Sharding-JDBC 垂直分库
    Sharding-JDBC 水平分库
    Vuejs基础使用
    webpack配置开发环境和生产环境
    webpack常见应用
    webpack-用loader加载css样式、图片、字体、数据
    webpack核心概念-模式/loader/插件及其他
  • 原文地址:https://www.cnblogs.com/zecVip/p/4432337.html
Copyright © 2020-2023  润新知