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. Java 正则表达式的实际应用

    正则表达式最详细-----> | |目录 1匹配验证-验证Email是否正确 2在字符串中查询字符或者字符串 3常用正则表达式 4正则表达式语法 1匹配验证-验证Email是否正确 public ...

  2. ios7 设置status bar风格

    How to change status bar style during launch on iOS 7 up vote4down votefavorite   When I launch my a ...

  3. 在MYSQL中运用全文索引(FULLTEXT index)

    在MYSQL中使用全文索引(FULLTEXT index) MYSQL的一个很有用的特性是使用全文索引(FULLTEXT index)查找文本的能力.目前只有使用MyISAM类型表的时候有效(MyIS ...

  4. ThinkPHP3.2.3完整版中对Auth.class.php的使用

    一,先创建数据表 1.think_auth_rule,规则表 id:主键, name:规则唯一标识, title:规则中文名称 status 状态:为1正常,为0禁用, condition:规则表达式 ...

  5. C# 控制win7任务栏、开始菜单的显示与隐藏

    因为是做显示程序,故需要控制任务栏与开始菜单的显示与隐藏,这样就美观些.不啰嗦.直接上代码: using System; using System.Collections.Generic; using ...

  6. WPF MultiSelect模式下ListBox 实现多个ListBoxItem拖拽

    WPF 的ListBox不支持很多常见的用户习惯,如在Explorer中用鼠标可以选择多项Item,并且点击已经选择的Item,按住鼠标左键可以将所有已选择Item拖拽到指定的位置.本文简单的实现了这 ...

  7. 创建Database Diagrams时遇到的问题

    SQL2008 R2中时,Diagrams的问题 Error: ------------------------------ Database diagram support objects cann ...

  8. MVC 路由调试工具-RouteDebugger

    MVC  路由调试工具-RouteDebugger 方案一: 在程序包控制台中执行命令 PM> Install-Package routedebugger 自动会在你的项目webconfig中& ...

  9. 离线安装 python 第三方库

     离线安装 python 第三方库 首先你需要在联网的服务器上已经安装了一个第三方库,比如是paramiko,也就是说你已经执行了 pip install paramiko    ,小提示: 如果在安 ...

  10. 《Servlet和jsp学习指南》 笔记1

    chapter 1 Servlet 4个java 包: 对于每一个http请求,Servlet请求都会创建一个ServletRequest实例,并将它传给Servlet的service方法.Servl ...