在jquery easyui的使用过程中,用到了孙宇的dialog扩展
/**
* 创建一个模式化的dialog
*
* @author 孙宇
*
* @requires jQuery,EasyUI
*
*/
sy.modalDialog = function(options) {
var opts = $.extend({
title : ' ',
width : 640,
height : 480,
modal : true,
onClose : function() {
$(this).dialog('destroy');
}
}, options);
opts.modal = true;// 强制此dialog为模式化,无视传递过来的modal参数
if (options.url) {
opts.content = '<iframe id="" src="' + options.url + '" allowTransparency="true" scrolling="auto" width="100%" height="98%" frameBorder="0" name=""></iframe>';
}
return $('<div/>').dialog(opts);
};
使用该扩展弹出对话框
<pre name="code" class="html">var sheight = $(window.parent).height();
var swidth = $(window.parent).width();
editDialog=parent.sy.modalDialog({
title : '用户信息修改',
url : '',
height:sheight,
width:swidth
});
子界面设置父界面的元素
$(window.parent.frames[1].document).find("input[id='editOpen']").attr("value","true");