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. HTML5+CSS3从入门到精通随书光盘 ISO 镜像视频教程​

    HTML5+CSS3从入门到精通(清华社“视频大讲堂”大系)通过基础知识+中小实例+综合案例的方式,讲述了用HTML5+ CSS3设计构建网站的必备知识,相对于权威指南.高级程序设计.开发指南同类图书 ...

  2. android 百度天气接口

    百度天气接口 之前有篇随笔是说中国气象的天气接口的,但那个接口不是很稳定,用一段时间过后就会获取不到数据了. 随笔地址:http://www.cnblogs.com/liangstudyhome/p/ ...

  3. c# 如何筛选datatable

    对DataTable数据各种筛选 筛选一个DataTable的数据,赋值给另外一个DataTable 假设: 有2个DataTable:DataTable A.DataTable B. 要求: 筛选D ...

  4. MariaDB 一些SQL语句的执行

    通过拼接的TAG_NAME字符串获取对应的TAG_ID字符串 形如: '丹药|练功流|轻松|学生|学院风' 查询结果:'10|35|36|40' SELECT GROUP_CONCAT(TAG_ID ...

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

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

  6. Win10 的操作中心如果不见了

    Win10 的操作中心如果不见了,可能是因为设置了不在任务栏显示操作中心,可以按照下面的设置来恢复. 1.单击开始菜单栏,打开设置: 2.选择个性化: 3.下图中,在左边选择"任务栏&quo ...

  7. UIImageView 动画

    1.UIImageView 动画 1.1 播放图片集 @property (nonatomic, strong) UIImageView *playImageView; self.playImageV ...

  8. Python第二周总结

    之所以晚发10天是因为中途发生了很多事情,让我比较懵,甚至都想放弃学Python,但自己选择的路,在艰难也得走下去,加油!!! 补充上期str后缀小魔法: 字符串一旦创建不得修改,一旦修改或拼接,就会 ...

  9. Codeforces Round #551 (Div. 2)A. Serval and Bus

    A. Serval and Bus time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  10. 初学python-字符串中引号的使用、input简介、强制类型转换、加减乘除简写、条件判断

    一.字符串中单引号和双引号的使用: 1.字符串以英文单引号' '引用.eg:'Hello World' 2.若字符串中含有单引号,则以英文双引号" "引用.eg:"I'm ...