* 创建添加或编辑窗口
*
* @param title
* @param addurl
* @param saveurl
*/
function createwindow(title, addurl,width,height) {
width = width?width:700
height = height?height:400
if(width=="100%" || height=="100%"){
width = document.body.offsetWidth
height =document.body.offsetHeight-100
}
if(typeof(windowapi) == 'undefined'){
$.dialog({
content: 'url:'+addurl,
lock : true,
width:width,
height:height,
title:title,
opacity : 0.3,
cache:false,
ok: function(){
iframe = this.iframe.contentWindow
saveObj()
return false
},
cancelVal: '关闭',
cancel: true /*为true等价于function(){}*/
})
}else{
W.$.dialog({
content: 'url:'+addurl,
lock : true,
width:width,
height:height,
parent:windowapi,
title:title,
opacity : 0.3,
cache:false,
ok: function(){
iframe = this.iframe.contentWindow
saveObj()
return false
},
cancelVal: '关闭',
cancel: true /*为true等价于function(){}*/
})
}
}
Ok:获取到Iframe的obj,就能 *** 作winA里面方法(如果你能看的懂这段代码的话……)
$("#"+id).datagrid("reload")......刷新datagrid的方法
1、你肯定会有一个按钮点击事件Onclick()之类的,点击可以d出dialog,还会有一个div加载需要dialog的需要的数据等。2、$("#divId").dialog({
里面类似easyui的dialog
})
3.点击事件在js添加一个$("#divId").dialog("open")
<!DOCTYPE html><html>
<head>
<meta charset="UTF-8">
<title>Custom Panel Tools - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="../../jquery.min.js"></script>
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
</head>
<body>
<h2>Custom Panel Tools</h2>
<p>Click the right top buttons to perform actions with panel.</p>
<div style="margin:20px 0 10px 0"></div>
<div class="easyui-panel" title="Custom Panel Tools" style="width:700pxheight:200pxpadding:10px"
data-options="iconCls:'icon-save',closable:true,tools:'#tt'">
<p style="font-size:14px">jQuery EasyUI framework helps you build your web pages easily.</p>
<ul>
<li>easyui is a collection of user-interface plugin based on jQuery.</li>
<li>easyui provides essential functionality for building modem, interactive, javascript applications.</li>
<li>using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.</li>
<li>complete framework for HTML5 web page.</li>
<li>easyui save your time and scales while developing your products.</li>
<li>easyui is very easy but powerful.</li>
</ul>
</div>
<div id="tt">
<a href="javascript:void(0)" class="icon-add" onclick="javascript:alert('add')"></a>
<a href="javascript:void(0)" class="icon-edit" onclick="javascript:alert('edit')"></a>
<a href="javascript:void(0)" class="icon-cut" onclick="javascript:alert('cut')"></a>
<a href="javascript:void(0)" class="icon-help" onclick="javascript:alert('help')"></a>
</div>
</body>
</html>
我觉得你可能是想要这个效果吧。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)