function openWin(){
var content ="<iframe src='user_adduser.action' width='99%' height='99%' frameborder='no' border='0' marginwidth='0' marginheight='0' scrolling='no' allowtransparency='yes'></iframe>"
parent.$("#addUserWin").window({
title:"添加用户",
modal:true,
width:300,
height:400,
content:content,
onClose:function(){
$("#dg").datagrid('reload');
},
})
}
跳转iframe
<body>
<div style="margin:15px 25px;">
<div class="easyui-panel" style="width:400px">
<div style="padding:10px 60px 20px 60px">
<form id="ff" method="post">
<table cellpadding="5">
<tr>
<td>名字:</td>
<td><input class="easyui-textbox" type="text" name="firstname" data-options="required:true"></input></td>
</tr>
<tr>
<td>身份证:</td>
<td><input class="easyui-textbox" type="text" name="card" data-options="required:true"></input></td>
</tr>
<tr>
<td>性别:</td>
<td><input type="radio" name="gender" value="1" checked="checked"/>男
<input type="radio" name="gender" value="2" />女</td>
</tr>
<tr>
<td>电话:</td>
<td><input class="easyui-textbox" name="phone" id="phone"></input></td>
</tr>
<tr>
<td>入住人数:</td>
<td><input class="easyui-textbox" name="count" id="count" ></input></td>
</tr>
</table>
</form>
<div style="text-align:center;padding:5px">
<a class="easyui-linkbutton" href="javascript:close()" >保存</a>
<input class="easyui-linkbutton" type="reset" style="width: 34px;height: 28px" value="取消" ></input>
</div>
</div>
</div>
</div>
数据表格
function close(){
var postData = $("#ff").serialize();
console.log(postData);
$.ajax({
url:'adduser.action',
dataType:'json',
method:'post',
data:postData,
success:function(data){
if(data.success='success'){
parent.$("#addUserWin").window('close');
}
}
})
}
点击保存添加数据
<div id=addUserWin>
</div>
父元素