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)';
}

最新文章

  1. 安装centOS分区的图解记录
  2. Git本地仓库
  3. ajx技术解析以及模拟jQuery封装
  4. wordpress搬家到本地URL修改问题
  5. [java] java解析txt文件
  6. Codeforces Codeforces Round #316 (Div. 2) C. Replacement set
  7. PKCS10生成证书csr
  8. HttpResponseRedirect VS HttpResponse
  9. Citrix 服务器虚拟化之二 Xenserver加域管理
  10. sql 判断两条数据库查询语句结果是否有重复
  11. xml中CDATA包含问题
  12. linux安装httpd,做文件服务器
  13. CRM系统数据授权
  14. target与currentTarget与this的区别
  15. 17. pt-online-schema-change
  16. 标签页(tab)切换的原生js,jquery和bootstrap实现
  17. 代码调试--自定义一个简单的debug函数
  18. SAS笔记
  19. 【BZOJ】4292: [PA2015]R&#243;wnanie
  20. jquery表格展示

热门文章

  1. python 测试报告发送邮件
  2. sql 与 oracle 几个简单语法差别
  3. [python]模块及包
  4. 独立线程监控配置文件是否变更,适用于更新了配置文件,不需要重启tomcat服务
  5. 类与类之间的两种关系------新标准c++程序设计
  6. Can&#39;t install Solaris 10 on XenServer 6.5 VM
  7. 同一个程序里有多个版本的App
  8. docker容器管理及网络管理
  9. 在虚拟机中连接oracle数据库报错ORA-12154,其他服务器连接无问题
  10. 导出当前python安装了哪些第三方模块+批量安装python模块