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();
}
}],
width: '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)';
}

弹出table页面--hq的更多相关文章

  1. 2016 系统设计第一期 (档案一)MVC bootstrap model弹出子页面

    通过bootstrap  弹出modal-dialog 子页面 ,例如我要弹出子页面:areaitem_sub_One.html. 具体步骤如下: 第一步:新建 areaitem_sub_One.ht ...

  2. 弹出框页面中使用jquery.validate验证控件

    弹出框页面中使用jquery.validate验证控件有几个问题需要解决: 1,弹出框的提交事件完成后如何关闭弹出框页面? 2,提交不成功如何返回当前页? 3,如果知道验证事件成功? 之前笔者都是JS ...

  3. ASP.NET查询页面设置form的action属性只弹出一个页面,并且每次将页面设置到最前

    原文:ASP.NET查询页面设置form的action属性只弹出一个页面,并且每次将页面设置到最前 背景 当数据量大.查询条件复杂,多样多的时候,我们可能需要单独做一个查询界面,当用户选择设置了相关的 ...

  4. 关闭Cadence Orcad Capture CIS原理图弹出startpage页面的方法

    打开原理图工具 Orcad Capture CIS 时,总是会弹出startpage 页面,有时候感觉这个东西挺碍事的,还是关了感觉好.解决方法如下:(1) View---Toolbar----Com ...

  5. js防止安卓手机软键盘弹出挤压页面导致变形的方法

    5防止安卓手机软键盘弹出挤压页面导致变形的方法 输入框定位在底部,手机端打开,输入框聚焦后软键盘打开为什么会瞬间自动关闭呢? 先看看问题: 1.原来是这样的: 2.在苹果手机里面是正常的: 3.到了安 ...

  6. 微信浏览器软键盘弹出与页面resize的问题

    使用微信打开网页,弹出软键盘时遇到的兼容问题 过去开发中遇到过很多这种情况,页面底部需要固定定位一个按钮,广告栏或者菜单栏,页面中有表单项需要填写,在打开手机虚拟键盘的时候,底部固定定位的元素会处在软 ...

  7. fullpage插件在移动端弹出键盘页面特殊处理

    fullpage插件大家都很熟悉 jquery一款全屏上下滑动的插件. 最近做公司一个活动移动端使用fullpage插件填写input的时候遇见一个问题,手机自带的键盘弹出的时候会把页面顶出去,页面错 ...

  8. layer 弹出层 回调函数调用 弹出层页面 函数

    1.项目中用到layer 弹出层,定义一个公用的窗口,问题来了窗口弹出来了,如何保存页面上的数据呢?疯狂百度之后,有了结果,赶紧记下. 2.自己定义的公共页面方法: layuiWindow: func ...

  9. js弹出div层,弹出层页面底部出现UL出现一条线问题

    整个弹出div层,列表满一页时:底部会出现一条横线 原因:ul固定写在页面中了 解决方法: 将ul代码与li列表一样写在js中,如下 var newhtml = '<ul class=" ...

随机推荐

  1. 关于IIS配置SimpleHandlerFactory-Integrated在其模块列表中有一个错误模块ManagedPipelineHandler的错误处理

    解决方法: 使用管理员运行aspnet_regiis.exe 命令:%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i v ...

  2. 请教一个Jquery ligerui 框架的小问题

    关闭子窗体时,要刷新父窗体,百度了很多像使用“window.opener.location.reload();”都不行,和easyui框架是有区别的 在子窗体里写Response.Write(&quo ...

  3. SQLServer 附加数据库后只读或报错解决方法

    百度文库地址 http://wenku.baidu.com/link?url=3EnK52mOtll3svjce0OGUUu7h9EOWkUgty8VChkxRdX7LQlm9Ll6N_78ENngN ...

  4. Mybatis-generator逆向工程

    $.Mybatis-generator介绍 MyBatis Generator(MBG)是MyBatis MyBatis 和iBATIS的代码生成器.它将为所有版本的MyBatis以及版本2.2.0之 ...

  5. L - Ch’s gift HDU - 6162

    Ch’s gift Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total S ...

  6. RadASM的主题更换!

    RadASM的代码编辑器默认背景色位黑色,我很不习惯,决定更换它,按照下面步骤,我把RadASM的代码编辑器默认背景色成功更换成了白色: 1, 2, 3, 4,

  7. loj#6437. 「PKUSC2018」PKUSC(计算几何)

    题面 传送门 题解 计算几何的东西我好像都已经忘光了-- 首先我们可以把原问题转化为另一个等价的问题:对于每一个敌人,我们以原点为圆心,画一个经过该点的圆,把这个圆在多边形内部的圆弧的度数加入答案.求 ...

  8. 1. C语言对文件的操作

    1. 文件常见输入输出函数与屏幕.键盘输入输出函数的对比,如:fprintf.fscanf等. #define _CRT_SECURE_NO_WARNINGS #include <stdio.h ...

  9. Python3用sys和time模块实现进度条

    import sys import time def view_bar(num, total): rate = float(num) / float(total) rate_num = int(rat ...

  10. How to: Create a Business Model in the XPO Data Model Designer

    How to: Create a Business Model in the XPO Data Model Designer This topic provides step-by-step inst ...