zoukankan      html  css  js  c++  java
  • window.showModalDialog

    今天接手一个项目用到window.showModalDialog以前完全没有过,既然碰到了就记下来。

    function showModalWindow(){
              //var answer = window.showModalDialog(url,window,'dialogWidth:1200px;dialogHeight:700px');
                var orgId = $("#orgId").text();
                var projectList = window.showModalDialog("doctor/inputTestProject?orgId="+orgId,null,
                    "dialogWidth=1100px;dialogHeight=590px;center:yes;resizable:no;status:no;scroll:no;");
                
                console.info(projectList);
                if(typeof(projectList)=="undefined")return false;
                $("#packageId").val(projectList[0].packageId);
                $("#packageMoney").val(projectList[0].packageMoney);
                if (projectList != null && typeof(projectList) != "undefined" && projectList.length > 0){
                    $("tr[name='mo']").each(function(){
                             $(this).remove();
                        });
                    var ids = [];
                    var str = "";
                    $("#ProjTab tr").each(function(index, item){
                           ids.push(item.id);
                    });
                    
                    for(var i = 0; i<projectList.length; i++){
                            str += "<tr name='mo' id='"+projectList[i].projectId+"' rowType='add'>"
                            +"<td class='biaotd'>"+Number(i+1)+"</td>"
                            +"<td class='biaotd'>"+projectList[i].projectName+"</td>"
                            +"<td class='biaotd'>"+projectList[i].projectType2Name+" &nbsp;</td></tr>"
                        }
                    $("#ProjTab tr:last-child").before(str);
                    changeFrame();
                }
            //window.location.reload(); //刷新父窗口 
        }
    window.showModalDialog弹出一个模态窗口,窗口关闭之前该方法会一直阻塞在哪里,窗口关闭之后才会继续往下执行(即窗口关闭之后才会执行包含console.info(projectList);之后的语句);
    欢迎大家前来指正
  • 相关阅读:
    欧拉函数、欧拉定理、费马小定理、拓展欧拉定理
    $CF 635 (Div 2)$
    $CF 634 (Div 3)$
    $CF 633 (Div 2)$
    $ACM$ 课第三次作业-搜索
    《信息安全数学基础一》第一章笔记
    接口测试工具与接口测试框架
    【python】基础知识小结
    【mongo】多个字段进行分组查询
    【mongo】去重操作
  • 原文地址:https://www.cnblogs.com/ph123/p/4410237.html
Copyright © 2011-2022 走看看