很多时候需要弹窗处理一些数据以下是弹窗的js代码
以下是要弹出的jsp的代码
<div id="dlg" closed="true" class="easyui-window" style="width:886px;height:567px;padding:10px;"></div>
<div id ="showjsp" title="showjsp" style="height: 20px;width: 200px">
<input type="button" value="click" onclick="showJsp1()"/>
</div>
//点击"查看"需要调用的方法 连接的地址(第二个div)
function showDiagSysj(tnum,id){
var sybhid=$("#"+id).combobox('getValue');
$('#zhendunreport').window({
title:'试验报告',//动态设表头
collapsible:false,
minimizable:false,
maximizable:false,
modal:true,
shadow: false,
href:'html/testreport/report'+tnum+'.jsp?tnum='+tnum+'&testcode='+sybhid+"&eqtype="+type//链接的地址
});
$('#zhendunreport').window('open');
}
以下是要弹出的jsp的代码
<html>
<head>
<title>糠醛试验报告<!-- 谷歌不行 --></title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<link rel="stylesheet" type="text/css"
href="../../lib/easyui/themes/gray/easyui.css">
<link rel="stylesheet" type="text/css"
href="../../lib/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../../css/demo.css">
<script type="text/javascript" src="../../lib/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="../../lib/jquery.easyui.min.js"></script>
<script type="text/javascript"
src="../../lib/easyui/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<table class="easyui-datagrid" style="width: 951px; height: 550px">
<thead>
<tr>
<th data-options="field:'C1',width:110,align:'center'">
Product
</th>
<th data-options="field:'C2',width:110,align:'center'">
Unit Cost
</th>
<th data-options="field:'C3',width:110,align:'center'">
C3
</th>
<th data-options="field:'C4',width:110,align:'center'">
List Price
</th>
<th data-options="field:'C5',width:110,align:'center'">
Attribute
</th>
<th data-options="field:'C6',width:110,align:'center'">
Item ID
</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(function(){
var tnum= '${param.tnum}';
var testcode= '${param.testcode}';
var eqtype= '${param.eqtype}';
testReportTab($('#zhendunreport').find('table'),tnum,testcode,eqtype);
})
function testReportTab(dom,tnum,testcode,eqtype){
dom.datagrid({
rownumbers: false,
showHeader:false,
singleSelect: true,
url:'findTestreportData.action?tnum='+tnum+'&testcode='+testcode+'&eqtype='+eqtype,
method: 'post',
fit:true,
fitColumns:true,
scrollbarSize:0,
onLoadSuccess: onLoadSuccess
});
}
function onLoadSuccess(data){
var hj=[{
index: 0,
colspan:6
},{
index: 10,
colspan:6
}];
var hj2=[{
index: 1,
colspan:2
},{
index: 2,
colspan:2
},{
index: 3,
colspan:2
},{
index: 4,
colspan:2
}];
var hj3=[{
index: 1,
colspan:2
},{
index: 2,
colspan:2
},{
index: 3,
colspan:2
},{
index: 4,
colspan:2
}];
var hj4=[{
index: 5,
colspan:2
},{
index: 6,
colspan:2
},{
index: 7,
colspan:2
},{
index: 8,
colspan:2
},{
index: 9,
colspan:2
}];
var hj5=[{
index: 5,
colspan:2
},{
index: 6,
colspan:2
},{
index: 7,
colspan:2
},{
index: 8,
colspan:2
},{
index: 9,
colspan:2
}];
var hj6=[{
index: 5,
colspan:3
},{
index: 6,
colspan:3
},{
index: 7,
colspan:3
},{
index: 8,
colspan:3
},{
index: 9,
colspan:3
}];
for ( var j = 0; j < hj.length; j++) {
$(this).datagrid('mergeCells',{
index:hj[j].index,
field:'C1',
colspan:hj[j].colspan
});
}
for ( var a = 0; a < hj2.length; a++) {
$(this).datagrid('mergeCells',{
index:hj2[a].index,
field:'C2',
colspan:hj2[a].colspan
});
}
for ( var a = 0; a < hj3.length; a++) {
$(this).datagrid('mergeCells',{
index:hj3[a].index,
field:'C5',
colspan:hj3[a].colspan
});
}
for ( var a = 0; a < hj5.length; a++) {
$(this).datagrid('mergeCells',{
index:hj5[a].index,
field:'C2',
colspan:hj5[a].colspan
});
}
for ( var a = 0; a < hj6.length; a++) {
$(this).datagrid('mergeCells',{
index:hj6[a].index,
field:'C4',
colspan:hj6[a].colspan
});
}
}
</script>
</body>
</html>