• 弹出table页面--hq


    function queryRelation(tableID,prosourceID){ //弹出页面 
    debugger;
    initqueryRelationGrid(tableID,prosourceID);
    var setting = {
    xType: "dialog",
    id: "queryRelationDiv",
    title: "对应关系",
    content: $("#queryRelationGridDiv"),
    button : [/*{
    name: "确定",
    handler: function(){

    }
    },*/{
    name: "关闭",
    handler: function(){
    document.getElementById("queryRelationGridDiv").parentNode.removeChild(document.getElementById("queryRelationGridDiv"));
    Hq.getCmp("queryRelationDiv").close();
    }
    }],
    '800px',
    height: '700px',
    maxFlag: false,
    minFlag: false,
    showMin : true,
    style: "white",
    logoIMG: "static/pub2.0/themes/flatblue/dialog/images/logo_ico.png",
    isModel: true,
    isDrag: true,
    isResize: false,
    closeFn: function() {
    document.getElementById("queryRelationGridDiv").parentNode.removeChild(document.getElementById("queryRelationGridDiv"));
    Hq.getCmp("queryRelationDiv").close();
    }
    };
    Hq.create(setting);

    }
    function initqueryRelationGrid(tableID,prosourceID){ //初始化div
    debugger;
    if(document.getElementById("queryRelationGridDiv")==null){
    $(document.body).append('<div id="queryRelationGridDiv"><div>');
    }
    $.ajax({
    url:"exp/dialogset/set/getRelation.do?tableID="+tableID+"&prosourceID="+prosourceID+"&tokenid="+tokenID,
    type:"get",
    cache:false,//设置浏览器不缓存页面
    beforeSend:function(){
    return true;
    },
    success:function(jsonObject){
    debugger;
    var shtml = "<table id='relationTable' cellpadding='3' cellspacing='1' bgcolor='#a1a1a1' width='100%'>"; //style='background-color: rgb(213, 229, 253);
    shtml+="<tr style='background-color: rgb(149, 205, 255)' height='24px'><td width='4%' align='center'>序号</td> <td width='30%' align='center'>表列名</td><td width='30%' align='center'>项目源列名</td><td width='30%' align='center'>操作列</td></tr>";
    for(var a = 0 ; a<jsonObject.length ; a++){
    shtml+="<tr id='"+jsonObject[0].id+"' onmouseover='changeRowOverColor(this)' onmouseout='changeRowOutColor(this)' style='background-color: rgb(213, 229, 253)'height='20px'>";
    shtml+="<td width='4%' align='center'>"+(a+1)+"</td>";
    shtml+="<td width='30%'>"+jsonObject[a].colname+"</td>";
    shtml+="<td width='30%'>"+jsonObject[a].procolname+"</td>";
    shtml+="<td width='30%' align='center'><button type='button' style='background-color:rgb(149, 205, 255);padding:0 20px 0 20px' onclick='deleteRelation(""+jsonObject[0].id+"",""+tableID+"",""+prosourceID+"")'>删除</button></td>";
    shtml+="</tr>";
    }
    shtml+="</table>";
    debugger;
    document.getElementById("queryRelationGridDiv").innerHTML+=shtml;
    }
    })
    };
    function deleteRelation(id,tableID,prosourceID){ //删除 
    Hq.Msg.confirm("您确定要删除这条对应关系吗?",function(){
    $.ajax({
    url:"exp/dialogset/set/deleteRelation.do?id="+id+"&tokenid="+tokenID,
    type:"get",
    cache:false,
    beforeSend:function(){
    },
    success:function(jsonObject){
    debugger;
    var msg=jsonObject.msg;
    alert(msg);
    document.getElementById("queryRelationGridDiv").removeChild(document.getElementById("relationTable"));
    initqueryRelationGrid(tableID,prosourceID);
    }
    })
    });

    }
    function changeRowOverColor(row){ //鼠标覆盖背景色 
    row.style.backgroundColor='rgb(255, 253, 217)';
    }
    function changeRowOutColor(row){
    row.style.backgroundColor='rgb(213, 229, 253)';
    }

  • 相关阅读:
    hive:(group by, having;order by)的使用;group by+多个字段,以及wiki说的group by两种使用限制验证
    hive parition的使用,分dynamic和static两种
    saiku运行时报错max_length_for_sort_data 需要set higher
    kettle文件自动化部署(shell脚本执行):命令行参数传入
    saiku显示不出新的cube(加载的cube,saiku会保存到缓存中,不重新加载)
    黑暗网络购物让你隐形參与犯罪
    Swift开发实例:苹果Swift编程语言新手教程中文版+FlappyBird,2048游戏源代码
    自己定义控件-DragButton
    无锁编程实战演练
    使用hint优化Oracle的运行计划 以及 SQL Tune Advisor的使用
  • 原文地址:https://www.cnblogs.com/sx2zx/p/6694603.html
Copyright © 2020-2023  润新知